From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#9412: sprintf-related integer and memory overflow issues Date: Wed, 31 Aug 2011 22:42:20 -0400 Message-ID: <87pqjlnfub.fsf@stupidchicken.com> References: <4E5D6772.7060208@cs.ucla.edu> <87vcteib8y.fsf@stupidchicken.com> <4E5DCE9B.9060903@cs.ucla.edu> <871uw136ei.fsf@stupidchicken.com> <4E5EB3F1.5030906@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314844976 10017 80.91.229.12 (1 Sep 2011 02:42:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2011 02:42:56 +0000 (UTC) Cc: 9412@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 01 04:42:52 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QyxEx-00069N-UT for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Sep 2011 04:42:52 +0200 Original-Received: from localhost ([::1]:34851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyxEx-0000fd-6h for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Aug 2011 22:42:51 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyxEu-0000fM-Mr for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2011 22:42:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyxEt-0006Zn-Lx for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2011 22:42:48 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyxEt-0006Zj-KV for bug-gnu-emacs@gnu.org; Wed, 31 Aug 2011 22:42:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QyxI2-00058Q-Qf; Wed, 31 Aug 2011 22:46:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Sep 2011 02:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 9412-submit@debbugs.gnu.org id=B9412.131484515319454 (code B ref 9412); Thu, 01 Sep 2011 02:46:02 +0000 Original-Received: (at 9412) by debbugs.gnu.org; 1 Sep 2011 02:45:53 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyxHs-00053Z-Ln for submit@debbugs.gnu.org; Wed, 31 Aug 2011 22:45:53 -0400 Original-Received: from vm-emlprdomr-03.its.yale.edu ([130.132.50.144]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QyxHl-00050T-Fi for 9412@debbugs.gnu.org; Wed, 31 Aug 2011 22:45:46 -0400 Original-Received: from furball (dhcp-128-36-14-41.central.yale.edu [128.36.14.41]) (authenticated bits=0) by vm-emlprdomr-03.its.yale.edu (8.14.4/8.14.4) with ESMTP id p812gKQD009459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 31 Aug 2011 22:42:21 -0400 In-Reply-To: <4E5EB3F1.5030906@cs.ucla.edu> (Paul Eggert's message of "Wed, 31 Aug 2011 15:21:37 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.144 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 31 Aug 2011 22:46:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50509 Archived-At: Paul Eggert 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).