mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
kallsyms: fix potential overflow in binary search
This will probably never trigger... but it won't hurt to be careful. http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com> Cc: Joshua Bloch <jjb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
58340a07c1
commit
2fc9c4e18f
1 changed files with 1 additions and 1 deletions
|
@ -176,7 +176,7 @@ static unsigned long get_symbol_pos(unsigned long addr,
|
|||
high = kallsyms_num_syms;
|
||||
|
||||
while (high - low > 1) {
|
||||
mid = (low + high) / 2;
|
||||
mid = low + (high - low) / 2;
|
||||
if (kallsyms_addresses[mid] <= addr)
|
||||
low = mid;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue