8156478: 3 Buffer overrun defect groups in jexec.c
authorhenryjen
Thu, 19 May 2016 21:59:35 -0700
changeset 38441 43ef784e3a96
parent 38440 9e77c5b81def
child 38442 387a4457880c
8156478: 3 Buffer overrun defect groups in jexec.c Reviewed-by: ksrini
jdk/src/java.base/unix/native/launcher/jexec.c
--- a/jdk/src/java.base/unix/native/launcher/jexec.c	Fri May 20 13:48:58 2016 +0900
+++ b/jdk/src/java.base/unix/native/launcher/jexec.c	Thu May 19 21:59:35 2016 -0700
@@ -331,6 +331,7 @@
                 off_t end   = start  + xlen;
 
                 if (end <= count) {
+                    end -= 4; // make sure there are 4 bytes to read at start
                     while (start < end) {
                         off_t xhid  = SH(buf, start);
                         off_t xdlen = SH(buf, start + 2);