lib: fix a Null Pointer Dereference bug.

Signed-off-by: mugitya03 <mugitya233@outlook.com>
This commit is contained in:
mugitya03 2025-02-07 18:56:56 -05:00 committed by GitHub
parent 2ef76a3350
commit b89e9dd0d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -693,7 +693,8 @@ static PyObject *elffile_secbyidx(struct elffile *w, Elf_Scn *scn, size_t idx)
}
ret = w->sects[idx];
Py_INCREF(ret);
if (ret)
Py_INCREF(ret);
return ret;
}