]> git.eshelyaron.com Git - emacs.git/commit
* font.c (font_unparse_xlfd): Don't blindly alloca long strings.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 29 Aug 2011 18:46:42 +0000 (11:46 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 29 Aug 2011 18:46:42 +0000 (11:46 -0700)
commitc21721cc3953732047ffdfe268764898f089f74b
tree3ada1b251b233bf7f723d8649384f6b2968078c8
parentb5cd19054673bfa46a4f0d1ac3905deeafcf94ff
* font.c (font_unparse_xlfd): Don't blindly alloca long strings.

Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
fits in int, when using sprintf.  Use single snprintf to count
length of string rather than counting it via multiple sprintfs;
that's simpler and more reliable.
(APPEND_SPRINTF): New macro.
(font_unparse_fcname): Use it to avoid sprintf buffer overrun.
(generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
sprintf, in case result does not fit in int.
src/ChangeLog
src/font.c