<Swing Dev> RfR JDK-8056925 Add jaccessinspector and jaccesswalker to the bin directory

Phil Race philip.race at oracle.com
Fri Nov 20 21:07:49 UTC 2015


On 11/20/2015 09:24 AM, Pete Brunet wrote:
> Please review:
> http://cr.openjdk.java.net/~ptbrunet/JDK-8056925/webrev.00/

   42 char *printError(char *msg) {
   43     LPVOID lpMsgBuf = NULL;
   44     static char retbuf[256];
   45
   46     if (msg != NULL) {
   47         strncpy((char *)retbuf, msg, sizeof(retbuf));
   48     }

If msg length >=256 chars you will not get a null terminated string.
I don't see that happening anywhere but defensive coding is best.

-phil.





More information about the swing-dev mailing list