From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 0C1707F3F for ; Wed, 12 Nov 2014 12:58:47 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id DEB99304043 for ; Wed, 12 Nov 2014 10:58:46 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) by cuda.sgi.com with ESMTP id GpM3K1S9jfNOnkDg (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 12 Nov 2014 10:58:45 -0800 (PST) Date: Wed, 12 Nov 2014 10:58:45 -0800 From: Christoph Hellwig Subject: Re: [PATCH 2/9] xfsdump: Fix overflow of "question" string in Media_prompt_erase() Message-ID: <20141112185845.GA24616@infradead.org> References: <1415818638-32700-1-git-send-email-sandeen@redhat.com> <1415818638-32700-3-git-send-email-sandeen@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1415818638-32700-3-git-send-email-sandeen@redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Eric Sandeen Cc: xfs@oss.sgi.com On Wed, Nov 12, 2014 at 12:57:11PM -0600, Eric Sandeen wrote: > The string we were sprintf'ing is trivially longer than the array > we allocated for it. > > Allocate something big enough, and snprintf to avoid overflow How about switching it to asprintf() to get rid of that dangerous static buffer entirely? _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs