RFR: (XS) 8214061: Buffer written into itself

Simon Tooke stooke at redhat.com
Tue Dec 4 14:57:41 UTC 2018


In one fatal error code path, snprintf() is given its output buffer asan
input string. 

src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c line 645: 

    (void)snprintf(buf, sizeof(buf), "JDWP %s", buf);

Proposed fix is of course:

    (void)snprintf(buf, sizeof(buf), "JDWP %s", msg);

This was found by compiling with GCC 8.1

Bug: https://bugs.openjdk.java.net/browse/JDK-8214061
webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/stooke/JDK-8214061/01/webrev/


Thanks,
-Simon Tooke



More information about the serviceability-dev mailing list