[11u] RFR: 8244225: stringop-overflow warning on strncpy call from compile_the_world_in

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Mon Jun 8 14:26:09 UTC 2020


Hi,

I would like to bring this to jdk11u-dev for parity with 11.0.9-oracle.

This is a fix that was only implemented for 11, so I can not see
the original implementation.
It fixes a gcc 8 warning in code that was removed later on.
I think we should fix this in open jdk11u too. This way, we can
be sure the fix is associated with the same bug.

I see the same message as reported in the bug when compiling
with gcc 8.2.
The cause for the warning is that (len-6) can be bigger than the

buffer size. Obviously the compiler inlined

string_ends_with() and CSEed the strlen() calls.



I implemented it by returning if len-6 is too long.

That is the same error handling as when there are

too many '.' in the filename.

Please review:

http://cr.openjdk.java.net/~goetz/wr20/8244225-stringop_gcc8_warning-jdk11/01/index.html

https://bugs.openjdk.java.net/browse/JDK-8244225

Best regards,
  Goetz.



More information about the jdk-updates-dev mailing list