diff options
author | Georg Fritzsche <georg.fritzsche@googlemail.com> | 2014-09-02 16:55:57 +0200 |
---|---|---|
committer | Georg Fritzsche <georg.fritzsche@googlemail.com> | 2014-09-02 16:55:57 +0200 |
commit | f6cdf929f75afd8327296a410feaaaedb24f7764 (patch) | |
tree | 506b01948c03fcb6d8255f8ef635f9d86a7e09b1 /coreconf | |
parent | 2f5b478459e5445df2bff625c5668a4d56dd4864 (diff) | |
download | nss-hg-f6cdf929f75afd8327296a410feaaaedb24f7764.tar.gz |
Bug 1061701 - Integer overflow in binary searches, r=kaie
Diffstat (limited to 'coreconf')
-rw-r--r-- | coreconf/mkdepend/parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreconf/mkdepend/parse.c b/coreconf/mkdepend/parse.c index 968d2c4ea..763ea0031 100644 --- a/coreconf/mkdepend/parse.c +++ b/coreconf/mkdepend/parse.c @@ -350,7 +350,7 @@ define2(char *name, char *val, struct inclist *file) /* Fast inline binary search */ register char *s1; register char *s2; - register int middle = (first + last) / 2; + register int middle = first + (last - first) / 2; /* Fast inline strchr() */ s1 = name; @@ -436,7 +436,7 @@ slookup(char *symbol, struct inclist *file) /* Fast inline binary search */ register char *s1; register char *s2; - register int middle = (first + last) / 2; + register int middle = first + (last - first) / 2; /* Fast inline strchr() */ s1 = symbol; |