bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9412: sprintf-related integer and memory overflow issues


From: Chong Yidong
Subject: bug#9412: sprintf-related integer and memory overflow issues
Date: Wed, 31 Aug 2011 22:42:20 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Paul Eggert <eggert@cs.ucla.edu> writes:

>> Surely such a limitation is a bug in the C library, not Emacs?
>> If so, it should be fixed there, not in Emacs.
>
> I agree, but unfortunately the problem is inherent to sprintf's type
> signature, which has been stable for many years and is not slated to
> be improved or extended even in C1X.  It would take decades before we
> could assume any such fix would be present in the C library.
>
>> I think we should add a stub for snprintf in sysdep.c for the
>> !HAVE_SNPRINTF case (which will need configure to set up HAVE_SNPRINTF).
>
> Sure, that's easily done, with the following additional patch.
> I'll CC: this to Eli since it adds a #define to nt/config.nt.

With this, the parts of the patch involving using snprintf look good.
But I would prefer to defer the esnprintf stuff till after 24.1.

The changes to font_unparse_xlfd and font_unparse_fcname don't look as
straightforward as the rest.  That code is somewhat fragile, so I
suggest double checking those changes (or, better yet, writing a test
case).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]