[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


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:



Best regards,

More information about the jdk-updates-dev mailing list