Skip to content

Commit

Permalink
kallsyms: fix potential overflow in binary search
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Joshua Bloch <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
vegard authored and torvalds committed Jul 25, 2008
1 parent 58340a0 commit 2fc9c4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fc9c4e

Please sign in to comment.