diff options
author | Sverker Eriksson <[email protected]> | 2018-01-12 15:33:12 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-01-15 17:25:11 +0100 |
commit | a8aeed346d0be42161a2563a09a4745b40d330ee (patch) | |
tree | e0d441ad65308d664eb63854d0792194f07d86bd | |
parent | 19b7ccfe076d88a96b62f3222f38be31bb087df2 (diff) | |
download | otp-a8aeed346d0be42161a2563a09a4745b40d330ee.tar.gz otp-a8aeed346d0be42161a2563a09a4745b40d330ee.tar.bz2 otp-a8aeed346d0be42161a2563a09a4745b40d330ee.zip |
erts: Fix buffer overflow bug in erts_printf %f
Sign character was not accounted for.
Ex:
float_to_list(-3.1265538967899625e+69, [{decimals,16}]).
-rw-r--r-- | erts/lib_src/common/erl_printf_format.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/lib_src/common/erl_printf_format.c b/erts/lib_src/common/erl_printf_format.c index 3daa066fd3..3302083288 100644 --- a/erts/lib_src/common/erl_printf_format.c +++ b/erts/lib_src/common/erl_printf_format.c @@ -331,7 +331,7 @@ static int fmt_double(fmtfn_t fn,void*arg,double val, char *bufp = sbuf; double dexp; int exp; - size_t max_size = 1; + size_t max_size = 2; /* including possible sign */ int size; int new_fmt = fmt; int fpe_was_unmasked; |