From patchwork Thu Dec 11 21:13:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 420253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F29ED1400F1 for ; Fri, 12 Dec 2014 08:13:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=PmO2SKqlfcrgmLgYzV+4FV0icHu8ywuHCxoPr0DS6rZSWe FkcIEEM+oedikrKCO20gdcYxQzz74YO0QtDAs8aXe/6DTXQ88o06BZBBay27Lg5Z Et31Efj7y7RIpLp9Lp/D+N/mxd42/fO0ZII84xN/rp47h180hBc3+LNsTP8Is= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=e5Ayd00eJYsfj6AdnK/ieC937gU=; b=KD32t8IzYtij7lxd01ow J+cGc9I4epE43MS7EeM/jgdEui/RX6CWn1WbvV2kh9cN1Ml7KvfJpXVt+iA6cnsi EbtW1afzJA/4rZrpdghK8Z/m3HdlOW5fi3rUYo0lxzx7+1ebQsQeVLJ5Eypu5Zy5 w4BOUTszrauBeCKEnnafwQI= Received: (qmail 22363 invoked by alias); 11 Dec 2014 21:13:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 22353 invoked by uid 89); 11 Dec 2014 21:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Fix -Wformat-security warnings in posix/regexbug1.c Message-Id: <20141211211313.D7F692C3ACD@topped-with-meat.com> Date: Thu, 11 Dec 2014 13:13:13 -0800 (PST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=Pvdyj71XLGGkHFDTvkkA:9 a=CjuIK1q_8ugA:10 2014-12-11 Roland McGrath * posix/regexbug1.c (main): Use "%s" format with regerror results, rather than assuming they won't contain any '%'s. --- a/posix/regexbug1.c +++ b/posix/regexbug1.c @@ -18,7 +18,7 @@ main (void) { char buf[100]; regerror (reerr, &re, buf, sizeof buf); - error (EXIT_FAILURE, 0, buf); + error (EXIT_FAILURE, 0, "%s", buf); } if (regexec (&re, "002", 2, ma, 0) != 0) @@ -35,7 +35,7 @@ main (void) { char buf[100]; regerror (reerr, &re, buf, sizeof buf); - error (EXIT_FAILURE, 0, buf); + error (EXIT_FAILURE, 0, "%s", buf); } if (regexec (&re, "002", 2, ma, 0) != 0)