# HG changeset patch # User mbaesken # Date 1487848575 -3600 # Thu Feb 23 12:16:15 2017 +0100 # Node ID 66988cd813e38c21d3b55ed6565a2e0e13eb2a40 # Parent b2661d26e55650cc0bf4c17e4faf6fb5bb53723b 8175000 : jexec fails to execute simple helloworld.jar diff --git a/src/java.base/unix/native/launcher/jexec.c b/src/java.base/unix/native/launcher/jexec.c --- a/src/java.base/unix/native/launcher/jexec.c +++ b/src/java.base/unix/native/launcher/jexec.c @@ -331,8 +331,9 @@ off_t end = start + xlen; if (end <= count) { - end -= 4; // make sure there are 4 bytes to read at start - while (start < end) { + // make sure there are 4 bytes to read at start + end -= 3; + while ((start < end) && (start < count-3)) { off_t xhid = SH(buf, start); off_t xdlen = SH(buf, start + 2);