]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib/clippy: fix symbol validity check
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 6 Jan 2023 16:05:25 +0000 (17:05 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Mon, 9 Jan 2023 18:27:02 +0000 (18:27 +0000)
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>
(cherry picked from commit a185874504654a691aa7c204b87ee2f9e3b8a49a)

lib/elf_py.c

index 75d2d6007f83d824fbb94544218f8e5a58439987..7c503cfb9db39e30b2e006700622364d24ebd64a 100644 (file)
@@ -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;