Commit bfdab44
committed
Fix null pointer dereference in DependencyInfoDumpingHandler
Add a null check for the return value of GetOutputStream() in
dependency_info.cc before dereferencing the stream pointer. When
GetOutputStream() fails to open the output file (e.g., due to
permission errors, full disk, or non-existent directory), it returns
nullptr. The code previously unconditionally dereferenced this pointer,
causing a segmentation fault (SIGSEGV).
This is the same vulnerability pattern that was fixed in
file_compiler.cc (commit 1d97901), but was missed in the
dependency_info.cc code path. The fix follows the identical pattern:
check the pointer for null before use and return false on failure.
Bug: Null pointer dereference when glslc is invoked with -MD flag
and the dependency info output file cannot be opened for writing.1 parent 42c364e commit bfdab44
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
0 commit comments