Skip to content

Commit

Permalink
vlc_arrays: mitigate bsearch signed overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fcartegnie committed Sep 14, 2016
1 parent d97c8e0 commit 53b7614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/vlc_arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static inline void *realloc_down( void *ptr, size_t size )
int low = 0, high = count - 1; \
answer = -1; \
while( low <= high ) {\
int mid = (low + high ) / 2; /* Just don't care about 2^30 tables */ \
int mid = ((unsigned int)low + (unsigned int)high) >> 1;\
zetype mid_val = entries[mid] elem;\
if( mid_val < key ) \
low = mid + 1; \
Expand Down

0 comments on commit 53b7614

Please sign in to comment.