From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 0458A3858413 for ; Tue, 30 Jan 2024 01:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0458A3858413 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0458A3858413 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706576759; cv=none; b=JkFIvWFh9GH779lAzdvuhRooX5t1Ac3/Y4dkkweLHHj60C/MR4ar7QSpoLWncq9KP/hxIxIsQ9XbMVN9yuYqqR5ZRduQD/UyOLKPOJ/B68LnK/WBAZG8QifIQ6KsWOF1fQwuDzZWmmPB5XvBvCAkefNiddMp63onJoB6F725/10= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706576759; c=relaxed/simple; bh=k4jdhGEHiUz93z4ZBn0h73zUIBko/DfsTchrNF1vVrU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GFD2YILXcO5gIe3yRfTOII52fHm5Sey/vZqd2qL7VVDEJAsamWgw4ULpRPNF32otrcUCr42uGU0hGzqT0o9HwH+bh9vndqZrKFBMM5JmbIEcK3LtBeT67E/hhH+EEAtZ2UVwujYW3tRz+RaB0MPqTkXc/LCNvcoPdWaQN9N4G44= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id UcQNrMQ0BMVQiUcZYrqVxT; Tue, 30 Jan 2024 01:05:56 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id UcZXrZLBUjqQkUcZXrFQoE; Tue, 30 Jan 2024 01:05:55 +0000 X-Authority-Analysis: v=2.4 cv=A7F/goaG c=1 sm=1 tr=0 ts=65b84b73 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=zstS-IiYAAAA:8 a=4HCetuFXo1Zvk4fGk-gA:9 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qx6vopRJoDKNq6ezWFrWQyQn0sf0vz8stbVKgNDdT+M=; b=p5ujkqp+3oGWUan17SskihwufO 3zPdeCxVJUpKsbJI19Hw5bh7PK4mCyoTRR5HcVJMYLPeiAI8uYm2H99vp8V7wr0urPjXfehckLK9D brd6ckcybPK1AQbTv1HlUDwEz; Received: from [161.98.8.3] (port=34570 helo=prentzel.ci.boulder.co.us) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rUcZW-003BfD-0S; Mon, 29 Jan 2024 18:05:54 -0700 From: Tom Tromey To: binutils@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/3] Do not call fputc from _bfd_doprnt Date: Mon, 29 Jan 2024 18:03:32 -0700 Message-ID: <20240130010540.1754740-3-tom@tromey.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130010540.1754740-1-tom@tromey.com> References: <20240130010540.1754740-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 161.98.8.3 X-Source-L: No X-Exim-ID: 1rUcZW-003BfD-0S X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (prentzel.ci.boulder.co.us) [161.98.8.3]:34570 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfEhUxVQ2xZ89/SVaoVLHhhucUboiOTmi8v8dRSeGzn02ss1bqCJxurOQj8DFHMF2jUAnv3VyFI1pFA49ZIF92MI31Lxx8UKNIE6LCy6p1FIZ79ykcvYA HWl+Bb+mqRy2LgkIBtkc71+AaR4TXveP+0OvjLjnaTU6QJkbqSRAVTmZag3HQVAM0nnTKMIe9SeFMs2lsZgl1X42onCwHioydao= X-Spam-Status: No, score=-3022.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I noticed that _bfd_doprnt can unconditionally call fputc. However, when called from error_handler_sprintf, this will likely result in a crash, as the stream argument does not actually point to a FILE. bfd/ChangeLog 2024-01-29 Tom Tromey * bfd.c (_bfd_doprnt): Do not call fputc. --- bfd/ChangeLog | 4 ++++ bfd/bfd.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bfd/bfd.c b/bfd/bfd.c index 5619799e403..0f1eaa1629f 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -1027,7 +1027,7 @@ _bfd_doprnt (print_func print, void *stream, const char *format, } else if (ptr[1] == '%') { - fputc ('%', stream); + print (stream, "%%"); result = 1; ptr += 2; } -- 2.43.0