unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 9412@debbugs.gnu.org
Subject: bug#9412: sprintf-related integer and memory overflow issues
Date: Wed, 31 Aug 2011 22:42:20 -0400	[thread overview]
Message-ID: <87pqjlnfub.fsf@stupidchicken.com> (raw)
In-Reply-To: <4E5EB3F1.5030906@cs.ucla.edu> (Paul Eggert's message of "Wed, 31 Aug 2011 15:21:37 -0700")

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	other threads:[~2011-09-01  2:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 22:42 bug#9412: sprintf-related integer and memory overflow issues Paul Eggert
2011-08-31  2:08 ` Chong Yidong
2011-08-31  6:03   ` Paul Eggert
2011-08-31 16:14     ` Chong Yidong
2011-08-31 22:21       ` Paul Eggert
2011-09-01  2:42         ` Chong Yidong [this message]
2011-09-01  5:44           ` Paul Eggert
2011-08-31 16:53     ` Dan Nicolaescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqjlnfub.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=9412@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).