summaryrefslogtreecommitdiff
path: root/coreconf
diff options
context:
space:
mode:
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>2014-09-02 16:55:57 +0200
committerGeorg Fritzsche <georg.fritzsche@googlemail.com>2014-09-02 16:55:57 +0200
commitf6cdf929f75afd8327296a410feaaaedb24f7764 (patch)
tree506b01948c03fcb6d8255f8ef635f9d86a7e09b1 /coreconf
parent2f5b478459e5445df2bff625c5668a4d56dd4864 (diff)
downloadnss-hg-f6cdf929f75afd8327296a410feaaaedb24f7764.tar.gz
Bug 1061701 - Integer overflow in binary searches, r=kaie
Diffstat (limited to 'coreconf')
-rw-r--r--coreconf/mkdepend/parse.c4
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;