]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix buffer overflow when printing small floats
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Apr 2019 12:30:24 +0000 (13:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Apr 2019 12:30:24 +0000 (13:30 +0100)
contrib/fpconv/fpconv.h
src/libutil/printf.c

index 83180d41f54262811fd3e75b732608ab6bd04dbe..0bc270b3155c30730b5226fe9d5eafc20e7f853c 100644 (file)
@@ -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
 
index 84dd5d27260a2d50e4f6c3e539d6f2e4d1af4fa3..6739fe142122aa6faa262cd2db5f1a5b54870ee2 100644 (file)
@@ -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;