diff options
author | David Mitchell <davem@iabyn.com> | 2019-08-20 13:03:58 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-08-20 13:47:16 +0100 |
commit | 3df4a9e6a0858b2eb211254bf6f09de3e233a172 (patch) | |
tree | eac91ac05fc834baa71c51a5fdfe378e05dd00f8 /util.c | |
parent | 285db6955f5604d4f99b127b881cc95bb1ef131d (diff) | |
download | perl-3df4a9e6a0858b2eb211254bf6f09de3e233a172.tar.gz |
Perl_quadmath_format_single(): fix off-by-1 err
RT #134369
This function checks that a floating format string (%f, %e etc) on
-Dusequadmath builds has the 'Q' qualifier , and if not adds it.
However, the "adding" code allocates a new buffer that is one byte too
short, which this commit fixes.
In practice it doesn't matter, as in core, this function is only ever
called when the 'Q' is already present.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4931,7 +4931,7 @@ Perl_quadmath_format_single(const char* format) return NULL; if (format[len - 2] != 'Q') { char* fixed; - Newx(fixed, len + 1, char); + Newx(fixed, len + 2, char); memcpy(fixed, format, len - 1); fixed[len - 1] = 'Q'; fixed[len ] = format[len - 1]; |