summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2009-10-03 02:42:16 +0000
committerwtc%google.com <devnull@localhost>2009-10-03 02:42:16 +0000
commit7cb375cec1395aea18816a12db795355298447c4 (patch)
treef9c023c0513b0633c0d50023f8849e303058f04c
parent1d81ffdb86c739d280f45b26094755f957427d38 (diff)
downloadnspr-hg-7cb375cec1395aea18816a12db795355298447c4.tar.gz
Bug 516396: Limit the input string for PR_strtod to at most 64 * 1024NSPR_4_7_6_BETA1
characters long to prevent PR_strtod from taking too long. Tag: NSPR_4_7_BRANCH
-rw-r--r--pr/src/misc/prdtoa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pr/src/misc/prdtoa.c b/pr/src/misc/prdtoa.c
index 1ec52daf..0889e678 100644
--- a/pr/src/misc/prdtoa.c
+++ b/pr/src/misc/prdtoa.c
@@ -1759,6 +1759,8 @@ PR_strtod
else
s = s00;
}
+ if (nd > 64 * 1024)
+ goto ret0;
if (!nd) {
if (!nz && !nz0) {
#ifdef INFNAN_CHECK
@@ -1789,6 +1791,7 @@ PR_strtod
}
#endif /* INFNAN_CHECK */
ret0:
+ PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
s = s00;
sign = 0;
}