RE: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread Langer, Christoph
Hi Chris, David and Thomas, I took a closer look now, too. Funny that the original change was contributed by my colleagues because of coverity and that they didn't do it completely right. 😉 As a code comment in our attachListener.hpp suggests, the '0' termination to please coverity was added fa

Re: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread David Holmes
On 6/03/2018 6:50 PM, Langer, Christoph wrote: Hi Chris, David and Thomas, I took a closer look now, too. Funny that the original change was contributed by my colleagues because of coverity and that they didn't do it completely right. 😉 As a code comment in our attachListener.hpp suggests, the

RE: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread Langer, Christoph
Thanks, David. A colleague just told me that a guarantee would also quiesce Coverity. So that could really be an option then. Let's wait for Chris' opinion... > -Original Message- > From: David Holmes [mailto:david.hol...@oracle.com] > Sent: Dienstag, 6. März 2018 13:26 > To: Langer, Chr

Re: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread Chris Plummer
On 3/6/18 4:26 AM, David Holmes wrote: On 6/03/2018 6:50 PM, Langer, Christoph wrote: Hi Chris, David and Thomas, I took a closer look now, too. Funny that the original change was contributed by my colleagues because of coverity and that they didn't do it completely right. 😉 As a code comment

RE: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread Langer, Christoph
Hi Chris, > > I don't know why strncpy would do zero padding? > From the man page: > > The stpncpy() and strncpy() functions copy at most len characters > from src into dst.  If src is less than len > characters long, the remainder of dst is filled with `\0' > characters.  Otherwise,

Re: RFR (XS): 8199010: attachListener.hpp: Fix potential null termination issue found by coverity scans

2018-03-06 Thread Thomas Stüfe
Maybe stupid question, any reason we could not just strdup() those strings? And add an ~AttachOperation dtor to clean them up again? Otherwise, I usually prefer using snprintf (or, jio_snprintf or the new os::snprintf()) with "%s" as format string: jio_snprintf(_name, sizeof(_name), "%s", inputst