http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47296
Janne Blomqvist <jb at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #5 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-15 09:18:18 UTC --- Nice catch. Looking at the code, when creating a SCRATCH file fails, unix.c:tempfile() returns -1, then as a result open_external() returns NULL, but then in open.c:new_unit() even though we have checked that open_external() returns NULL, we still call unpack_filename(), as well as accessing opp->file_len. Just to be sure, I suspect it would be prudent to set opp->file to NULL and opp->file_len to 0 in tempfile() in case fd < 0. Or are we sure that the entire opp struct is set to 0 sometime before?