RFR: (XS) 8214061: Buffer written into itself

Daniel D. Daugherty daniel.daugherty at oracle.com
Tue Dec 4 15:08:54 UTC 2018



On 12/4/18 9:57 AM, Simon Tooke wrote:
> 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/

src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c
     No comments.

Thumbs up.

Dan


>
>
> Thanks,
> -Simon Tooke
>



More information about the serviceability-dev mailing list