Browse Source

[Fix] Fix buffer overflow when printing small floats

tags/1.9.3
Vsevolod Stakhov 5 years ago
parent
commit
92a1f7a412
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      contrib/fpconv/fpconv.h
  2. 1
    1
      src/libutil/printf.c

+ 1
- 1
contrib/fpconv/fpconv.h View File

* *
*/ */


int fpconv_dtoa(double fp, char dest[24], bool scientific);
int fpconv_dtoa(double fp, char dest[32], bool scientific);


#endif #endif



+ 1
- 1
src/libutil/printf.c View File

const gchar *fmt, const gchar *fmt,
va_list args) 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; const gchar *buf_start = fmt, *fmt_start = NULL;
gint d; gint d;
gdouble f; gdouble f;

Loading…
Cancel
Save