summaryrefslogtreecommitdiff
path: root/lib/elf_py.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 17:05:25 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-01-06 17:05:25 +0100
commita185874504654a691aa7c204b87ee2f9e3b8a49a (patch)
tree756eb9f1df59e4e3be0253b6a1ef60ecc63afc8e /lib/elf_py.c
parentee4a6b9f654fbd4e07485037481ad6b4766bbc6d (diff)
lib/clippy: fix symbol validity check
If symvalid is false, looking at symidx is bogus. This fixes a build-time SEGV on mips64el. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/elf_py.c')
-rw-r--r--lib/elf_py.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/elf_py.c b/lib/elf_py.c
index 75d2d6007f..7c503cfb9d 100644
--- a/lib/elf_py.c
+++ b/lib/elf_py.c
@@ -293,7 +293,7 @@ static PyObject *elfreloc_getsection(PyObject *self, PyObject *args)
if (!w->es)
Py_RETURN_NONE;
- if (w->symidx == 0) {
+ if (!w->symvalid || w->symidx == 0) {
size_t idx = 0;
Elf_Scn *scn;