Parcourir la source

[Fix] Fix buffer overflow when printing small floats

tags/1.9.3
Vsevolod Stakhov il y a 5 ans
Parent
révision
92a1f7a412
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1
    1
      contrib/fpconv/fpconv.h
  2. 1
    1
      src/libutil/printf.c

+ 1
- 1
contrib/fpconv/fpconv.h Voir le fichier

@@ -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


+ 1
- 1
src/libutil/printf.c Voir le fichier

@@ -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;

Chargement…
Annuler
Enregistrer