tweaks: some extra checks on lengths
This commit is contained in:
committed by
Markus F.X.J. Oberhumer
parent
4f3054f07d
commit
4702f12818
@@ -241,6 +241,9 @@ int __acc_cdecl_qsort le64_compare_signed(const void *e1, const void *e2) {
|
||||
int find(const void *b, int blen, const void *what, int wlen) {
|
||||
if (b == NULL || blen <= 0 || what == NULL || wlen <= 0)
|
||||
return -1;
|
||||
// Fast exit if the wanted string is longer than the buffer.
|
||||
if (wlen > blen)
|
||||
return -1;
|
||||
|
||||
int i;
|
||||
const unsigned char *base = (const unsigned char *) b;
|
||||
|
||||
Reference in New Issue
Block a user