From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10337 Path: news.gmane.org!not-for-mail From: Jacob Abrams Newsgroups: gmane.linux.lib.musl.general Subject: vprintf.c bug Date: Tue, 26 Jul 2016 15:25:40 -0700 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1469575945 22720 80.91.229.3 (26 Jul 2016 23:32:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2016 23:32:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10350-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 27 01:32:24 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bSBpk-0003GA-N9 for gllmg-musl@m.gmane.org; Wed, 27 Jul 2016 01:32:20 +0200 Original-Received: (qmail 9668 invoked by uid 550); 26 Jul 2016 23:32:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 16069 invoked from network); 26 Jul 2016 22:25:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clover.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=owpJ3yKE9qLbyXU5SC8M3GtNzxP8XbqmGQznGuSTcvE=; b=hia4s+hNqS5WprLhkNc/NBaf88DiZJxGe03+upVpE3jmHGsQIt/0mpO51DEnoFEA/y b566nlUmyDWDsP+5TrjqaSObAM0BWhuo4zgXSatY7IJ1lLxLEJXcVhkT4qJk7gdU+6zo nDAijmd/OUvIUR5k83SmsJjUaRv9ff8Clx6vFmsRo7W4X+vtsK9oKLbZB8dZ4LyDUtda ngB/++Cl7r6rU1gQ46/9jvhaIZSRglkTKGPNoMv3aYwxQ/krNII0bWePaoHPoVi1oVxm Y3kA8AjQJlcaaf+xgIBo9vBDfm29tY2egUeN79vzA5hcuKFu/4J76UhLFCY5rXT+uzyD 6sIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=owpJ3yKE9qLbyXU5SC8M3GtNzxP8XbqmGQznGuSTcvE=; b=F+PoizX6XG3wVint8t5Cx3R7tX01FOj1tjc7u1SIgCTEdDU/d1LwLHTQTT4gGiixkn P1d+fFa8xKoQ6wMKb9ud68yLoGp+TRD6oFsUBD6aC5y+GsXr08FzQjw2qHX6Q61XXI7F LwpIkrbFWpF+c5P1P2dEf06O0fvdHC1m7vdhSe3Y3JWcbHoa8ALU2PVV4Q0jh0fMSqWN CK40vR7WYY9A5SQUaOwIz/Tx3qbeKh7LuFVKP1Jku1+uW7aijZDSfQtq7Ryf6OkgZjpa NjATSaM/e0Nbnz4HOKfagvEpXREBkt1AhmY7YUn/Nl2wOrFIFPYM282LpPcIZBnq9bjY PEqg== X-Gm-Message-State: AEkooussdlPy4bYK52DK02p7/rS6rL8uooqrjgNvyroGBUI6nipLBDCQiX/uUZUu/yDYvHJxyfm5G1GrcUU0Xh6b X-Received: by 10.55.106.195 with SMTP id f186mr31073818qkc.52.1469571940915; Tue, 26 Jul 2016 15:25:40 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:10337 Archived-At: I believe there is a small bug in vfprintf.c I had to change the if statement from ret = printf_core(f, fmt, &ap2, nl_arg, nl_type); if (saved_buf) { to ret = printf_core(f, fmt, &ap2, nl_arg, nl_type); if (f->buf == internal_buf) { Because the saved_buf may be NULL which will result the internal buffer being used but the file not being reset properly after the call to printf_core. This was discovered while using MUSL v1.1.4 on an OS other than Linux. Please cc-me on any response. Regards, Jacob jacob@clover.com