From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] don't dereference NULL upon failed malloc and realloc Date: Mon, 22 Jun 2009 13:43:13 +0200 Message-ID: <877hz4cx4e.fsf@meyering.net> References: <87tz29pp6b.fsf@meyering.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245671044 18251 80.91.229.12 (22 Jun 2009 11:44:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 11:44:04 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 22 13:44:00 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIhwM-0003Hz-8u for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 13:43:58 +0200 Original-Received: from localhost ([127.0.0.1]:52237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIhwL-0004Hq-Mh for ged-emacs-devel@m.gmane.org; Mon, 22 Jun 2009 07:43:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIhvq-00044I-GR for emacs-devel@gnu.org; Mon, 22 Jun 2009 07:43:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIhvl-00041r-Vx for emacs-devel@gnu.org; Mon, 22 Jun 2009 07:43:26 -0400 Original-Received: from [199.232.76.173] (port=52288 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIhvl-00041h-MR for emacs-devel@gnu.org; Mon, 22 Jun 2009 07:43:21 -0400 Original-Received: from smtp3-g21.free.fr ([212.27.42.3]:50038) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIhvk-0002lD-4J for emacs-devel@gnu.org; Mon, 22 Jun 2009 07:43:20 -0400 Original-Received: from smtp3-g21.free.fr (localhost [127.0.0.1]) by smtp3-g21.free.fr (Postfix) with ESMTP id B76058181A5 for ; Mon, 22 Jun 2009 13:43:16 +0200 (CEST) Original-Received: from mx.meyering.net (mx.meyering.net [82.230.74.64]) by smtp3-g21.free.fr (Postfix) with ESMTP id A2CD681819A for ; Mon, 22 Jun 2009 13:43:13 +0200 (CEST) Original-Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 8733934739; Mon, 22 Jun 2009 13:43:13 +0200 (CEST) In-Reply-To: <87tz29pp6b.fsf@meyering.net> (Jim Meyering's message of "Sun, 21 Jun 2009 17:44:12 +0200") Original-Lines: 17 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111632 Archived-At: Jim Meyering wrote: > Hello, > > I noticed some potential NULL-deref-after-failed-malloc/realloc. > Here's one way to fix them: If no one objects, I'll commit this in about 5 hours. >>>From 4c51394b3fc14f108404689dade9629bc6b0cefc Mon Sep 17 00:00:00 2001 > From: Jim Meyering > Date: Sun, 21 Jun 2009 17:13:38 +0200 > Subject: [PATCH] don't dereference NULL upon failed malloc and realloc > > * src/ftfont.c (setup_otf_gstring, ftfont_shape_by_flt): Use xmalloc > and xrealloc, so subsequent dereferences of unchecked *alloc-return > values are valid. ...