Message ID | 20240130010540.1754740-3-tom@tromey.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp928047dyb; Mon, 29 Jan 2024 17:06:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtobRRsh2ENjfEAwJxPezSHWWWINCTp6I9Srd8WMQYn9xY5E6uGAldjCyx89yGdG01fWip X-Received: by 2002:a05:6214:f6e:b0:686:949c:1dc1 with SMTP id iy14-20020a0562140f6e00b00686949c1dc1mr8879624qvb.10.1706576777501; Mon, 29 Jan 2024 17:06:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706576777; cv=pass; d=google.com; s=arc-20160816; b=MKAavxDiC+Lfg4rH4jbOEOZksW3I17HkCJl0jSvl2PitDXFqG6U2v+xPyXeRPy177z V+qUtTunnVAWH8mgAWHuj5S7MoAH39OYXb3Tgu10TaqZ7sjuypyQYFn6CMFLyk9wm17G kf6prlG5gC23rvVmlvoDu7TFqedn076BeFxJF2Q8LP0L/obKOeJGVSmGLpvOUC+6/hoo +GRW5W/ZEMLP5L0SwXKtt9jPSLgkZizxQOPKqL2s/VW0kf6ox5593Ts0GXwViqEZWKya O8rcgvuzG46pdfZPx+NsOX6nSVUyT7Q9rk8bG/Mt9ae9mG6k8vuD98l6Dar1hU3G6djW DD/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=qx6vopRJoDKNq6ezWFrWQyQn0sf0vz8stbVKgNDdT+M=; fh=PTZv/fEnntkVjZjJeDKIkUWVkECXkQyaIllNGCyO/VM=; b=w+6teqd1KWqdEnM7g/3YXWko3Q60fLnZxxpCcybaISISb9YRpDKh8Wkazd/2OM9x6c fgVS4LTtAmFDOUp8TioiP8F9AOqYeNFxgxEQzojlvgGHW5A2n4tB7Url4xRXHVP0544F mDQQiZKCtVYURipASW+PUrGo/GVEG2KkH0ixbsCoNzcRVDf31+u0DZHyoui0YQCM3Yj5 /ualYD9iLV0I/4gkejFxNRM/u+dLJUE8vj+XSsVuGMM6yy/9PuQDL+ur4kP69iupUehz xtgf/Vj1Q/bjnHyKItP5od8SpaVdNSz+RAL+r8YKYuJZ0vCvY6Gsl1dPYlG6Ex+2jqmC kenQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=p5ujkqp+; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id c6-20020a05620a164600b00783e000b202si7407279qko.345.2024.01.29.17.06.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 17:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@tromey.com header.s=default header.b=p5ujkqp+; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 261503858437 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 01:06:17 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 <binutils@sourceware.org>; 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 <tom@tromey.com>) id 1rUcZW-003BfD-0S; Mon, 29 Jan 2024 18:05:54 -0700 From: Tom Tromey <tom@tromey.com> To: binutils@sourceware.org Cc: Tom Tromey <tom@tromey.com> 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789475451187113001 X-GMAIL-MSGID: 1789475451187113001 |
Series |
Fix some error-printing issues
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Tom Tromey
Jan. 30, 2024, 1:03 a.m. UTC
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 <tom@tromey.com> * bfd.c (_bfd_doprnt): Do not call fputc. --- bfd/ChangeLog | 4 ++++ bfd/bfd.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
Comments
Hi Tom, > 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 <tom@tromey.com> > > * bfd.c (_bfd_doprnt): Do not call fputc. Approved - please apply. Cheers Nick
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; }