From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2952 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Weird bug in syslog Date: Wed, 20 Mar 2013 15:02:50 -0400 Message-ID: <20130320190249.GQ20323@brightrain.aerifal.cx> References: <1363721555.2099.0@eros> <20130320124125.GL19010@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1363806183 12230 80.91.229.3 (20 Mar 2013 19:03:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2013 19:03:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2953-gllmg-musl=m.gmane.org@lists.openwall.com Wed Mar 20 20:03:27 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UIOIJ-0006uF-AY for gllmg-musl@plane.gmane.org; Wed, 20 Mar 2013 20:03:27 +0100 Original-Received: (qmail 9397 invoked by uid 550); 20 Mar 2013 19:03:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 9389 invoked from network); 20 Mar 2013 19:03:03 -0000 Content-Disposition: inline In-Reply-To: <20130320124125.GL19010@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2952 Archived-At: On Wed, Mar 20, 2013 at 01:41:26PM +0100, Szabolcs Nagy wrote: > > l2 = vsnprintf(buf+l, sizeof buf - l, message, ap); > > if (l2 >= 0) { > > l += l2; > > these are int values > maybe we should care about overflow > (eg making l size_t works) Not needed. snprintf returns int. But it *can* fail: EOVERFLOW. Rich