diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2003-05-05 19:54:28 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2003-05-05 19:54:28 +0000 |
| commit | 4f4cc4f7a3f2d2c36a7297a9749776e4273f1f71 (patch) | |
| tree | 2946ae2028efe9070738cc2e8effe065270ba458 /main/snprintf.c | |
| parent | b874a54846cdffa119de9df2d730e7166b444320 (diff) | |
| download | php-git-4f4cc4f7a3f2d2c36a7297a9749776e4273f1f71.tar.gz | |
Sanity check that ensures proper handling of 'E' doubles/floats as well as
prevents an unlikely buffer overflow.
Diffstat (limited to 'main/snprintf.c')
| -rw-r--r-- | main/snprintf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/snprintf.c b/main/snprintf.c index fc3d5de153..a43f362ab6 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -387,6 +387,10 @@ ap_php_gcvt(double number, int ndigit, char *buf, boolean_e altform) register int i; char buf1[NDIG]; + if (ndigit >= NDIG - 1) { + ndigit = NDIG - 2; + } + p1 = ap_php_ecvt(number, ndigit, &decpt, &sign, buf1); p2 = buf; if (sign) |
