RFR: (XS) 8214061: Buffer written into itself

Severin Gehwolf sgehwolf at redhat.com
Tue Dec 4 16:02:49 UTC 2018


Hi,

On Tue, 2018-12-04 at 10:08 -0500, Daniel D. Daugherty wrote:
> 
> 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.

Can this be considered trivial enough to only require one reviewer?

FWIW, this looks good to me too, but I'm not a Reviewer.

Thanks,
Severin



More information about the serviceability-dev mailing list