diff options
author | wtc%google.com <devnull@localhost> | 2009-10-03 02:42:16 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2009-10-03 02:42:16 +0000 |
commit | 7cb375cec1395aea18816a12db795355298447c4 (patch) | |
tree | f9c023c0513b0633c0d50023f8849e303058f04c | |
parent | 1d81ffdb86c739d280f45b26094755f957427d38 (diff) | |
download | nspr-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.c | 3 |
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; } |