提交 9b831820 编写于 作者: R Rich Felker

fix inadvertent use of uninitialized variable in dladdr

commit c8b49b2f 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.
上级 524e76f1
...@@ -2217,7 +2217,7 @@ int dladdr(const void *addr_arg, Dl_info *info) ...@@ -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; best = 0;
bestsym = 0; bestsym = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册