# HG changeset patch # User aidan # Date 1164718889 0 # Node ID fcf6ccb70eea2be1f5a808a39e88f67b99c06b39 # Parent e2053838832f133aec2f5bf7c66764e669b43a3a [xemacs-hg @ 2006-11-28 13:01:27 by aidan] Fix a crash when (format "%f" 1.2e+302) is evaluated. diff -r e2053838832f -r fcf6ccb70eea src/ChangeLog --- a/src/ChangeLog Mon Nov 27 22:51:20 2006 +0000 +++ b/src/ChangeLog Tue Nov 28 13:01:29 2006 +0000 @@ -1,3 +1,10 @@ +2006-11-28 Aidan Kehoe + + * doprnt.c (emacs_doprnt_1): + Integrate Sebastian Freundt's SXEmacs bug fix for cases where a + format specifier overflows the allocated buffer with a float + format string. + 2006-11-23 Robert Pluim * sysdep.c (strlwr): Don't intermix declarations and code. diff -r e2053838832f -r fcf6ccb70eea src/doprnt.c --- a/src/doprnt.c Mon Nov 27 22:51:20 2006 +0000 +++ b/src/doprnt.c Tue Nov 28 13:01:29 2006 +0000 @@ -776,16 +776,9 @@ #endif /* HAVE_BIGFLOAT */ else { - /* ASCII Decimal representation uses 2.4 times as many - bits as machine binary. */ - char *text_to_print = - alloca_array (char, 32 + - max (spec->minwidth, - (int) max (sizeof (double), - sizeof (long)) * 3 + - max (spec->precision, 0))); - char constructed_spec[100]; - char *p = constructed_spec; + Ibyte *text_to_print = alloca_array (char, 350); + Ibyte constructed_spec[100]; + Ibyte *p = constructed_spec; /* Mostly reconstruct the spec and use sprintf() to format the string. */