Filename buffers too small after fix for 6938627

Andreas Kohn andreas.kohn at
Sun Apr 11 11:57:51 PDT 2010


while reading a bit the hotspot sources I noticed a potential issue with
the fix for 6938627 (Make temporary directory use property 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.

Attached patch changes the buffers to PATH_MAX+1 bytes, the same value
used by other places that call get_temp_directory().


Never attribute to malice that which can be adequately explained by
stupidity.                                        -- Hanlon's Razor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6938627-bufs.diff
Type: text/x-patch
Size: 1586 bytes
Url : 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : 

More information about the hotspot-dev mailing list