From: Vsevolod Stakhov Date: Thu, 25 Apr 2019 12:30:24 +0000 (+0100) Subject: [Fix] Fix buffer overflow when printing small floats X-Git-Tag: 1.9.3~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92a1f7a412f35354e3e471aadeeba537b18ab45e;p=thirdparty%2Frspamd.git [Fix] Fix buffer overflow when printing small floats --- diff --git a/contrib/fpconv/fpconv.h b/contrib/fpconv/fpconv.h index 83180d41f5..0bc270b315 100644 --- a/contrib/fpconv/fpconv.h +++ b/contrib/fpconv/fpconv.h @@ -26,7 +26,7 @@ * */ -int fpconv_dtoa(double fp, char dest[24], bool scientific); +int fpconv_dtoa(double fp, char dest[32], bool scientific); #endif diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 84dd5d2726..6739fe1421 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -591,7 +591,7 @@ rspamd_vprintf_common (rspamd_printf_append_func func, const gchar *fmt, va_list args) { - gchar zero, numbuf[G_ASCII_DTOSTR_BUF_SIZE], dtoabuf[24], *p, *last, c; + gchar zero, numbuf[G_ASCII_DTOSTR_BUF_SIZE], dtoabuf[32], *p, *last, c; const gchar *buf_start = fmt, *fmt_start = NULL; gint d; gdouble f;