diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-07-06 17:47:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-07-06 17:47:43 -0400 |
commit | 9b83182069cc3b213277104a992e195982060146 (patch) | |
tree | 0be211aca98cf76b3458315aee67cc325d764d68 | |
parent | 524e76f17b296ce36c2fb1a1469e814a045ec957 (diff) | |
download | musl-9b83182069cc3b213277104a992e195982060146.tar.gz musl-9b83182069cc3b213277104a992e195982060146.tar.bz2 musl-9b83182069cc3b213277104a992e195982060146.tar.xz musl-9b83182069cc3b213277104a992e195982060146.zip |
fix inadvertent use of uninitialized variable in dladdr
commit c8b49b2fbc7faa8bf065220f11963d76c8a2eb93 introduced code that
checked bestsym to determine whether a matching symbol was found, but
bestsym is uninitialized if not. instead use best, consistent with use
in the rest of the function.
simplified from bug report and patch by Cheng Liu.
-rw-r--r-- | ldso/dynlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c index db543c19..d1edb131 100644 --- a/ldso/dynlink.c +++ b/ldso/dynlink.c @@ -2217,7 +2217,7 @@ int dladdr(const void *addr_arg, Dl_info *info) } } - if (bestsym && besterr > bestsym->st_size-1) { + if (best && besterr > bestsym->st_size-1) { best = 0; bestsym = 0; } |