Filename buffers too small after fix for 6938627
coleen.phillimore at Oracle.COM
Mon Apr 19 07:15:09 PDT 2010
I'll file a bug since it's my fault. Actually the temp file name will
be truncated if it's > 40 and not overrun (use snprintf) but it would be
better to be FILE_MAX or whatever OS specific length it should be. If
you want to submit a patch I'll make you the contributor and check it in.
Andreas Kohn wrote:
> On Sun, 2010-04-11 at 20:57 +0200, Andreas Kohn wrote:
>> while reading a bit the hotspot sources I noticed a potential issue with
>> the fix for 6938627 (Make temporary directory use property
>> java.io.tmpdir when specified) in some places.
>> Before the fix the callers of get_temp_directory() could hardcode the
>> size of the filename buffer to a small number, but now that
>> get_temp_directory() returns a value settable by the user this looks a
>> bit dangerous.
>> In particular:
>> both use a 128 byte buffer
>> uses a 40 byte buffer.
> Should I open a bug for this one?
More information about the hotspot-dev