diff options
| author | Sungwoo Kim <contact@sung-woo.kim> | 2024-02-20 00:56:30 -0500 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-02-21 14:46:23 +0000 |
| commit | 3eb4f0c2a392b15406af944af98065c12634affd (patch) | |
| tree | 9fe575729b92dd5a7522534eced2fd648e9452d8 /executor/executor_fuchsia.h | |
| parent | 4622e01246e4f835db558e8c3144c7ca6ea767e6 (diff) | |
vm/qemu.go: fix nil-ptr-deref in ctor
os.Stat() may return (nil, err) if it fails to open a file.
So, the code below wrongly validates st as it will be always nil
if err != nil, causing nil pointer dereference in st.Size().
```
if st, err := os.Stat(inst.image); err != nil && st.Size() == 0 {
```
To fix this, this patch allows st.Size() only if err == nil.
Diffstat (limited to 'executor/executor_fuchsia.h')
0 files changed, 0 insertions, 0 deletions
