RFR: 8u: 8076475: Misuses of strncpy/strncat

Andrew Hughes gnu.andrew at redhat.com
Fri Apr 3 03:44:10 UTC 2020



On 02/04/2020 09:36, Andrew Haley wrote:
> On 4/1/20 6:54 PM, Andrew Hughes wrote:
>> * src/share/vm/runtime/os.{c,h}pp
>>   If we're going to add strdup_check_oom, I think this should be done by
>> backporting JDK-6424123 [1] so it's used consistently throughout the
>> codebase rather than just the two call sites in this patch.
> 
> I strongly disagree that we should import such a patch into JDK 8 for
> this reason.
> 
> It's a judgement call, of course. We have two desiderata here: those
> of consistently backporting patches and minimizing changes. As JDK 8
> matures, minimizing change has become more and more important, and it's
> perfectly OK to snip small fragments of patches such as this in order
> to minimize change.
> 
> Of course I'm aware of the other side of the argument, but I don't
> think it's as important.
> 

And I strongly disagree with turning 8u into a unmaintainable mass of
partial chunks of code from various changesets.  In this case, it would
lead to a strdup failure being handled differently, depending on where
in the code it occurred.

The alternative would be to use os::strdup directly and avoid
introducing this function. This was how JDK-8155968 already handled this
issue.
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222



More information about the jdk8u-dev mailing list