There is already a check for File being null, but it is then dereferenced anyway.
Our downstream port caused this to crash.
Differential D34752
[LLD][ELF] Fix nullptr dereference when creating an error message. seaneveson on Jun 28 2017, 7:50 AM. Authored by
Details
There is already a check for File being null, but it is then dereferenced anyway. Our downstream port caused this to crash.
Diff Detail Event TimelineComment Actions Thank you for your patch! Could you add a test?
Comment Actions Changed to early return as requested. I haven't been able to find a way to test this, as the crash only occurs for errors in internal sections and I can't find a good way to force one. Do you have any ideas? Thanks for the review. |
You want to return "(internal):" + Name + "+0x" + utohexstr(Off) +")" here if File is null, so that you can remove the null checks below.