GNU bug report logs - #50767
28.0.50; Warnings about snprintf in image.c on armv7l

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Basil L. Contovounesios" <contovob@HIDDEN>; Keywords: patch moreinfo; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 50767 <at> debbugs.gnu.org and "Basil L. Contovounesios" <contovob@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 15 Nov 2021 05:53:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 15 00:53:41 2021
Received: from localhost ([127.0.0.1]:52268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmUw1-0007NG-K2
	for submit <at> debbugs.gnu.org; Mon, 15 Nov 2021 00:53:41 -0500
Received: from quimby.gnus.org ([95.216.78.240]:40172)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mmUvz-0007Mz-My
 for 50767 <at> debbugs.gnu.org; Mon, 15 Nov 2021 00:53:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=VZsslxxglexxEgxwTFkgi4sSeMIiiKmVlvZQ0xvHAAU=; b=CaBOBhdd+0SOL5xc/uEpJqZuiz
 7Kwue5lhFdiy2QxbXle7dAlQ/4Ce5ouldwhLiW0lDuSbYzsLr0nei4vu+FGc9KFq9OJxaF1f+cIJ3
 h0Wkz8i4Kh5qHYnqEni2FjDd9AYiwW+suXcSYARGzrO/uJnHeL9/HKYNjDjlCg7Gz0pQ=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mmUvr-0002AN-1C; Mon, 15 Nov 2021 06:53:33 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
 <87ilx7mgzw.fsf@HIDDEN> <YYZt1tQLs6qVYrhe@HIDDEN>
 <87fss9b0xh.fsf@HIDDEN> <87pmr2pbal.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACVBMVEXO1dWNcDX////Y
 16zIAAAAAWJLR0QCZgt8ZAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+ULDwUxGpgaPfUA
 AACNSURBVCjP3Y9BDgMhCEUxkb1N5D6Q1L0mcP+rDKOOdNFtNzUx4Ql8/wf4x4PWT01mesB+Cven
 6RPgK/AsdMF6zUngiBFlYCh7vhPHsrYIqZYDWi0xpn0QPjBEYg5JFUPAtD7ORndy81MFxYxkC9YJ
 3rhlJCWzxiunC6PZNvp2AyuOd/nlmUqZK8Did09dr8clJGwSuaAAAABaZVhJZk1NACoAAAAIAAUB
 EgADAAAAAQABAAABGgAFAAAAAQAAAEoBGwAFAAAAAQAAAFIBKAADAAAAAQACAAACEwADAAAAAQAB
 AAAAAAAAAAAASAAAAAEAAABIAAAAAR9S9zQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTEtMTVU
 MDU6NDk6MjYrMDA6MDAk2HZlAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTExLTE1VDA1OjQ5OjI2
 KzAwOjAwVYXO2QAAABd0RVh0ZXhpZjpZQ2JDclBvc2l0aW9uaW5nADGsD4BjAAAAMHRFWHRpY2M6
 Y29weXJpZ2h0AENvcHlyaWdodCAyMDAwIEFkb2JlIFN5c3RlbXMsIEluYy6pb7Z0AAAAKXRFWHRp
 Y2M6ZGVzY3JpcHRpb24AVS5TLiBXZWIgQ29hdGVkIChTV09QKSB2MqZOuwAAAAAASUVORK5CYII=
X-Now-Playing: Herbert's _Musca_: "Two Doors feat. Joy Morgan"
Date: Mon, 15 Nov 2021 06:53:30 +0100
In-Reply-To: <87pmr2pbal.fsf@HIDDEN> (Basil L. Contovounesios's message of
 "Mon, 15 Nov 2021 01:28:18 +0200")
Message-ID: <87k0ha0xt1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  "Basil L. Contovounesios" <contovob@HIDDEN> writes: > Sorry, 
 I won't be able to for a while :(. Feel free to close this bug, > and I'll
 chime back in when I'm at a keyboard again if necessary. OK; closing. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, Alan Third <alan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

"Basil L. Contovounesios" <contovob@HIDDEN> writes:

> Sorry, I won't be able to for a while :(.  Feel free to close this bug,
> and I'll chime back in when I'm at a keyboard again if necessary.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Nov 2021 23:28:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 18:28:35 2021
Received: from localhost ([127.0.0.1]:52004 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmOvE-0005b2-M1
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 18:28:35 -0500
Received: from mail-ed1-f52.google.com ([209.85.208.52]:35618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mmOvC-0005ap-PY
 for 50767 <at> debbugs.gnu.org; Sun, 14 Nov 2021 18:28:27 -0500
Received: by mail-ed1-f52.google.com with SMTP id g14so63624680edz.2
 for <50767 <at> debbugs.gnu.org>; Sun, 14 Nov 2021 15:28:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=IvDDM58yJ2PiZh+ds1gSnJr1sSjgiH2tiWzJnOsJ+EI=;
 b=VSpnL7g/GG2Y+XUPKr4pRJJfpqTSLEreW0qQoeQEO0AEUt3D3AGX/ZiXveVgwhWK82
 nlpT3tst11jYMNDA7Wwx+7WdmBRm4F1AOmx3rn+O1hMPFA0m5Syk5AoVKKnHTF3QUVDZ
 ujjCFa5G/Ag9ZqmOL4LfWlvZdyEgDFACoY7rFxTRbQisE92SdurqVQUC+uS4LzX0HmuH
 tqBXOwqS5bjT+/PZp69YdF6FyQ5Ac10fs6paXTJssHfVD6W3ROGc/UyOIyMXrxyazkuP
 Ey9xCOYpjez0h+z6snIOqeRmBUr0ySFJ04cKWBbvrSmFYF2vrCCrG91FOELKdrTBPYM4
 0bNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=IvDDM58yJ2PiZh+ds1gSnJr1sSjgiH2tiWzJnOsJ+EI=;
 b=UBlQZKS8KwoEE1Uny1EX56xbGlvuS4KLTz7bQFr0ZxPZdA14oVi1ZvCPtXFNa7zwmZ
 sqF2pVlUfimqrga6nj0xjym2nzXn4Lln+DnlVmjiKjxX5tJyU4AsQqWmKca148aS3fIh
 m4j4ZwtE8ySAW0TrbWVPsvcijzMz9LrLgFZJZjrK/JxQFcDy4NmlHezbuzddYqspqZiv
 BC4Ans7kTVDNJPPbZwAnQvaJ19E/ggOnEORetu/RthpEx+XwCRfEAr0qten96v0NUb+L
 voPOXZC1MAmeZNSMvXtHKsFIF+Wvc3D3twRCOJaEjzf9LvLHh9KhtwknEWIC2XNulLms
 IxBw==
X-Gm-Message-State: AOAM533e8GTkvMAgeFgcZWlqNUIa6NPv07QnrvCITeDR0i4osHvXp+Xm
 tkPS4t6+T4lS0kPU4ox5OXCFk3h6qz8woxOS
X-Google-Smtp-Source: ABdhPJztYKm3jL6B0qXz9ia4AHoOO/d/rmBvDJ8uqNbpRJQ0aRQFAeqbwakeWmYf8tw+ATKDXF9hfQ==
X-Received: by 2002:a05:6402:22a5:: with SMTP id
 cx5mr16773160edb.334.1636932501027; 
 Sun, 14 Nov 2021 15:28:21 -0800 (PST)
Received: from localhost (adsl-118.91.140.89.tellas.gr. [91.140.89.118])
 by smtp.gmail.com with ESMTPSA id nb17sm5599788ejc.7.2021.11.14.15.28.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 14 Nov 2021 15:28:20 -0800 (PST)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
 <87ilx7mgzw.fsf@HIDDEN> <YYZt1tQLs6qVYrhe@HIDDEN>
 <87fss9b0xh.fsf@HIDDEN>
Date: Mon, 15 Nov 2021 01:28:18 +0200
In-Reply-To: <87fss9b0xh.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 06 Nov 2021 19:20:58 +0100")
Message-ID: <87pmr2pbal.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, Alan Third <alan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen [2021-11-06 19:20 +0100] wrote:

> Alan Third <alan@HIDDEN> writes:
>
>>> > Thanks, and sorry for the late reply.  I haven't had a chance to compile
>>> > this on armv7l yet, but I should be able to later today or tomorrow.  It
>>> > continues to compile without warnings on x86_64.
>>> 
>>> This was three weeks ago -- the patch was applied, as far as I can tell?
>>> Skimming this thread, it's not quite clear whether there's anything more
>>> to do here?
>>
>> I didn't expect my patch to actually silence the warnings. I've no way
>> to find out if it has, either.
>
> Perhaps Basil can check?

Sorry, I won't be able to for a while :(.  Feel free to close this bug,
and I'll chime back in when I'm at a keyboard again if necessary.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 6 Nov 2021 18:21:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 06 14:21:10 2021
Received: from localhost ([127.0.0.1]:50555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mjQJS-00045o-52
	for submit <at> debbugs.gnu.org; Sat, 06 Nov 2021 14:21:10 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mjQJQ-00045b-SH
 for 50767 <at> debbugs.gnu.org; Sat, 06 Nov 2021 14:21:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=gDylMjGjRScZhwa6G4WM1qbD1dsjjgiPFGw19BwUqsU=; b=Mi1AUs9aDoUA0ucdfo42Qwi4fP
 I7K3inq8A+3HfUL8T7GM9wke9d9UN+PDsDU99l5IxrkOMb8268vj8Fp1uGYD5b2zdzev/uSWiStnX
 MZ+SzK44N05wGHQ4kuGUZV8c6x8Vq5WXI4eUKLtj99CDV8Uwu7mjMbxUq2asyXL8xKFs=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mjQJH-0000QD-9X; Sat, 06 Nov 2021 19:21:02 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alan Third <alan@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
 <87ilx7mgzw.fsf@HIDDEN> <YYZt1tQLs6qVYrhe@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEX6+vfn5NaqpZnb
 39XW1M3UyraZiHl6bGiqwqHItqn////0osDuAAAAAWJLR0QKaND0VgAAAAd0SU1FB+ULBhIMO9r6
 n2oAAAGqSURBVDjL5dO/b5tAFAfwo7iVsnE5GDL2yTZmAx1/QBDvIjGCeFUZ6yFWVoawe/KYnkzS
 +297gIWr2lWkrP2KBT53737owdhlHM75J+Ym/ErSW+Yu7jPMM0Ss7Rg7KuEyRcfCFwi3XbsL2/D7
 4bDZHw77zQa4BSfFLEUPpe85QiSJ5LkUwwyXiZhJKWKZ5jKP0yyVUk7geENlLxaMc/sI4Qnnjrns
 Wj4Awb/A/zhUYKqoivT2cXoXJwgKMK9hB78MxH/CTQtak0H9VGg9Cp/grWsN6a2OnrSJjme4gQ52
 PYVR/W2JqvfOMy7zLgAYQ82qJ6KxEvMmuFuvGqo0ENk9LM/g2OHUdLCOegif4X6GIDCqVgA7gHXX
 6q8zHH1jqr6BRwB7eoi8Eyx6wmpVgI603tmC8GNe/HyrDrd96F3CnAlcbY4qS+wG8rSA9csMDxFm
 BZXcR1S1GQ8ygrMMetvIvm/BRpl5V9zWCWhIjaanpjxB2vwU8nb4rBSRoqae4DMdkWcc/ZKycpho
 +niEoOQ4/i0ZV4R7WNn7ee8c/ycs+NXEtkuH2F79K78BdqdwbmQ0LlMAAAAldEVYdGRhdGU6Y3Jl
 YXRlADIwMjEtMTEtMDZUMTg6MTI6NTkrMDA6MDAlr6aZAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIx
 LTExLTA2VDE4OjEyOjU5KzAwOjAwVPIeJQAAAABJRU5ErkJggg==
X-Now-Playing: Floating Points with Pharoah Sanders and the London Symphony
 Orchestra's _Promises_: "Movement 2"
Date: Sat, 06 Nov 2021 19:20:58 +0100
In-Reply-To: <YYZt1tQLs6qVYrhe@HIDDEN> (Alan Third's message of "Sat, 6
 Nov 2021 11:58:14 +0000")
Message-ID: <87fss9b0xh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Alan Third <alan@HIDDEN> writes: >> > Thanks, and sorry
 for the late reply. I haven't had a chance to compile >> > this on armv7l
 yet, but I should be able to later today or tomorrow. It >> > continues to
 compile without warnings on [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Alan Third <alan@HIDDEN> writes:

>> > Thanks, and sorry for the late reply.  I haven't had a chance to compile
>> > this on armv7l yet, but I should be able to later today or tomorrow.  It
>> > continues to compile without warnings on x86_64.
>> 
>> This was three weeks ago -- the patch was applied, as far as I can tell?
>> Skimming this thread, it's not quite clear whether there's anything more
>> to do here?
>
> I didn't expect my patch to actually silence the warnings. I've no way
> to find out if it has, either.

Perhaps Basil can check?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 6 Nov 2021 11:58:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 06 07:58:29 2021
Received: from localhost ([127.0.0.1]:48637 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mjKL6-0002Gh-QM
	for submit <at> debbugs.gnu.org; Sat, 06 Nov 2021 07:58:29 -0400
Received: from outbound.soverin.net ([116.202.126.228]:52839)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mjKL2-0002GQ-Ss
 for 50767 <at> debbugs.gnu.org; Sat, 06 Nov 2021 07:58:27 -0400
Received: from smtp.soverin.net (unknown [10.10.3.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 5868E29F;
 Sat,  6 Nov 2021 11:58:18 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1636199897; bh=SKhJzq/Ej+wH/qUJja3B2iNRD+mNpSPxZb0YJKmAnIQ=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=Zdy79O8tgzsBL9jjzsuLRz6nDWCb3y7QGIehqQbXh/W5SIiQPOjc+1J5oEFTpfvZz
 SlZiYynnzYeV1O2n3+5vI0cLX1WK0DZ7mxkhCReulUbd8r9eaA1lrVZvybWmfYsf8y
 p5Ehtmw5WbR4V4GoxJP5ckkKjil6HrV+cBmOvCp7bfNBshYCxdwb9ImpF49ZZolgHV
 O5lajnvKD2mrbBZ+fsodNjkJn6Lb4yChv9IP6jgaBsTKQBb0ksy1LYICfhW+RZio/N
 fPYOeUNAcIr/JkuG/s2m2WgmPkcXay3mEfmqMbGFsU9v9ihRJlj4wYDFa+LG44JHaM
 lzzHjuNLSAOdA==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mjKKs-000BxE-Dm;
 Sat, 06 Nov 2021 11:58:14 +0000
Date: Sat, 6 Nov 2021 11:58:14 +0000
From: Alan Third <alan@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YYZt1tQLs6qVYrhe@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 Lars Ingebrigtsen <larsi@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
 <87ilx7mgzw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87ilx7mgzw.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
Cc: "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Fri, Nov 05, 2021 at 04:13:55AM +0100, Lars Ingebrigtsen wrote:
> "Basil L. Contovounesios" <contovob@HIDDEN> writes:
> 
> > Thanks, and sorry for the late reply.  I haven't had a chance to compile
> > this on armv7l yet, but I should be able to later today or tomorrow.  It
> > continues to compile without warnings on x86_64.
> 
> This was three weeks ago -- the patch was applied, as far as I can tell?
> Skimming this thread, it's not quite clear whether there's anything more
> to do here?

I didn't expect my patch to actually silence the warnings. I've no way
to find out if it has, either.

-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 5 Nov 2021 03:14:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 04 23:14:07 2021
Received: from localhost ([127.0.0.1]:44162 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mipg7-00047l-Kb
	for submit <at> debbugs.gnu.org; Thu, 04 Nov 2021 23:14:07 -0400
Received: from quimby.gnus.org ([95.216.78.240]:34426)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mipg6-000478-4z
 for 50767 <at> debbugs.gnu.org; Thu, 04 Nov 2021 23:14:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=Jsn9UUWXFw6YgBTUeiVHhrlvPwhpSVJvx4grXlN77b8=; b=to0RPd65HqmrbVUQI7aXpacmId
 7abw8y1N8TkF/IeopJ2O1GTTPm3gTmZPw6re9h6a63bTE2Nhd8NBoOT+gS+UVeSs7ZQD+eTeUtVMm
 1Bw7NE5xBG3+/K2CDNQ26mmMdKX/guCv87RnfDndunh6yheXyeOpATap01ziGeJ6E3mI=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mipfw-0000Xq-18; Fri, 05 Nov 2021 04:13:59 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
X-Now-Playing: Fairport Convention's _Come All Ye (5)_: "Down in the Flood"
Date: Fri, 05 Nov 2021 04:13:55 +0100
In-Reply-To: <87wnmfhat2.fsf@HIDDEN> (Basil L. Contovounesios's message of
 "Thu, 14 Oct 2021 16:43:05 +0100")
Message-ID: <87ilx7mgzw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: "Basil L. Contovounesios" <contovob@HIDDEN> writes: > Thanks,
 and sorry for the late reply. I haven't had a chance to compile > this on
 armv7l yet, but I should be able to later today or tomorrow. It > continues
 to compile without warnings on x86_64. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, Alan Third <alan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

"Basil L. Contovounesios" <contovob@HIDDEN> writes:

> Thanks, and sorry for the late reply.  I haven't had a chance to compile
> this on armv7l yet, but I should be able to later today or tomorrow.  It
> continues to compile without warnings on x86_64.

This was three weeks ago -- the patch was applied, as far as I can tell?
Skimming this thread, it's not quite clear whether there's anything more
to do here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 15 Oct 2021 17:26:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 15 13:26:26 2021
Received: from localhost ([127.0.0.1]:40380 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mbQyQ-0006eB-IA
	for submit <at> debbugs.gnu.org; Fri, 15 Oct 2021 13:26:26 -0400
Received: from outbound.soverin.net ([116.202.126.228]:47285)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mbQyK-0006dt-4N
 for 50767 <at> debbugs.gnu.org; Fri, 15 Oct 2021 13:26:25 -0400
Received: from smtp.soverin.net (unknown [10.10.3.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 79C3E187;
 Fri, 15 Oct 2021 17:26:13 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1634318772; bh=j0Pg4VQ42wzsLfcf79FCtOWrDjuGeg5fDEy6EQcLxqc=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=IdTkhzis8btZCTsghyBypWyin7w2qK4RkVMBNFXtCJwIDqEBNEWRqi4aepW7f6IA6
 9FqjbvYb4c4PW1FYqif8N6l2R4ySmJ45RtuFXwwWWSjxPeSpTuicSNFHdszQfk5bJN
 RskY7Meggwtmr1K9pIM+iElIStxkwTZpKSaASll3+Nwf5r1ERokb4hsGTQJBDPdWbp
 er2/7hyhw8CWa4zLuSoktq13AddrC6MEd43P7Nez1FjZr+878Zfmwh78tknxNWKOoA
 0W4HTJYNF3rrJADtu4PXDAVvfZnIlmVnhL1cKaYN2P+0LLcVu9D5hgnZaa7nb/SLeS
 GuQMUg+KVPETQ==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mbQyB-000GLN-N9;
 Fri, 15 Oct 2021 18:26:11 +0100
Date: Fri, 15 Oct 2021 18:26:11 +0100
From: Alan Third <alan@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YWm5s4UwSK4T46Ax@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN> <87wnmfhat2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87wnmfhat2.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Thu, Oct 14, 2021 at 04:43:05PM +0100, Basil L. Contovounesios wrote:
> Alan Third [2021-10-04 22:45 +0100] wrote:
> 
> > On Thu, Sep 23, 2021 at 11:49:37PM +0100, Alan Third wrote:
> >> On Thu, Sep 23, 2021 at 11:38:06PM +0100, Basil L. Contovounesios wrote:
> >> > ...which would mean this only holds in the common case that
> >> > face_font_size has fewer than 5 digits, right?
> >> 
> >> Looks that way.
> >> 
> >> I suppose in this particular case we could limit the font size to a
> >> maximum of 9999 or something, but surely there's a better way of
> >> calculating string sizes?
> >
> > I've implemented a pretty basic check so we shouldn't accidentally
> > overrun the buffer. See attached.
> 
> Thanks, and sorry for the late reply.  I haven't had a chance to compile
> this on armv7l yet, but I should be able to later today or tomorrow.  It
> continues to compile without warnings on x86_64.

I'm not sure it'll silence the warnings, as I'm not sure what we need
to do for that, but it should at least reduce the chances of an
overflow.
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Oct 2021 16:43:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 12:43:22 2021
Received: from localhost ([127.0.0.1]:36956 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb3pB-0005aC-Uo
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:43:22 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35938)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mb3p7-0005Zw-Jv
 for 50767 <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:43:20 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54568)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mb3p0-0007iQ-KT; Thu, 14 Oct 2021 12:43:10 -0400
Received: from [87.69.77.57] (port=1191 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mb3p0-0006Sd-7U; Thu, 14 Oct 2021 12:43:10 -0400
Date: Thu, 14 Oct 2021 19:43:08 +0300
Message-Id: <835ytzlfqb.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
In-Reply-To: <87wnmf5zr0.fsf@HIDDEN> (contovob@HIDDEN)
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <83ilyqtqzc.fsf@HIDDEN> <87zgrbhau7.fsf@HIDDEN>
 <838ryvlhov.fsf@HIDDEN> <87wnmf5zr0.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, alan@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: "Basil L. Contovounesios" <contovob@HIDDEN>
> Cc: alan@HIDDEN,  50767 <at> debbugs.gnu.org
> Date: Thu, 14 Oct 2021 17:37:23 +0100
> 
> >   if (!val && size)
> >     memory_full (size);
> 
> Sorry, I thought xsignal in memory_full would return, because I confused
> it with nonlocal exits in dynamic modules which do.

No need to be sorry.  Emacs is tricky.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Oct 2021 16:37:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 12:37:36 2021
Received: from localhost ([127.0.0.1]:36952 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb3jc-0005Rp-7E
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:37:36 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:42972)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mb3jX-0005RY-7v
 for 50767 <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:37:34 -0400
Received: by mail-wr1-f42.google.com with SMTP id v17so21310018wrv.9
 for <50767 <at> debbugs.gnu.org>; Thu, 14 Oct 2021 09:37:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=+It5ru8bKlIy+PoJjDHRNXhYC9qYk09Zk5D8kTcTVfk=;
 b=fYOtj6FTBGol5yW0kyprAMl5oFWA15Cy75H2RoUFLjgOM4J/CmmfJ9FLx3WA4Fv9Lk
 lYWe/L4Blu/A79R+uSkyYGoSYsQCoi0z9myBSvNlAZQWL3kSBAHWkQYPvqy3G9ZLoppM
 YCeE63EhHcRRKINN/OYZqc9xk/K8UUcA41J/o5L1gDWZvsSz3WOboWGghcchodbIbRkz
 9JME++PKfgIFLN5KYIcVYdikfA2jtamNDp8R6maiHPaHeb54uBEet1WS1Ip149xbCyLX
 cfGjncXTYbpS/gPND5ycN+w+sKgxDPM+pDAWUcoPB4+Y5PtzP8XVECoYT3Ox7HlQZNBB
 dYWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=+It5ru8bKlIy+PoJjDHRNXhYC9qYk09Zk5D8kTcTVfk=;
 b=fIUe/yrbWC84bWScAbkeI1FDWYbrSRLxE/gjs/+V9xJ5Mh/0ooILZ5AS8uh5ns8wvt
 hG5MHLBJdbH5FjnQ+cnkT2i6pdtHNQKNd4PVI74QL385qNdRw7rbfCSllOH/j6h4JWY2
 bEYnbfrKl71okiioX/U5ZXDnUcaN7IN3dz4t5lZVA1eNDJg4Qj/BIs8xjEtHqgOQ1uK9
 JTAW7rAI1nKcfgCJCOOKGlKNi250e46eO6wsRvbrs3cI1gjG5PZanPDlVceP3pdgAovF
 iR5XawlAIfjt0hdLFkGbCS5+RIXqq6Iwhvqcs++zWlOlXxByJ6zD285C36zO54c/Phy5
 kDCw==
X-Gm-Message-State: AOAM531gJTD6yhb3SlXHO5JZTxosKVMbEMASt6jDG+84gmHGaSbfPPdz
 Xz/pFhs3GV0MoSB5P9vNZzDaBg==
X-Google-Smtp-Source: ABdhPJyIiOfVIxXXvRvQ6izPzUZ6LMIYpv7qSAQrvVKW8z6dtMOYO5pBd+s9irfWMKq6HYZSOd03dQ==
X-Received: by 2002:adf:8b1a:: with SMTP id n26mr7797460wra.182.1634229445159; 
 Thu, 14 Oct 2021 09:37:25 -0700 (PDT)
Received: from localhost ([89.101.154.41])
 by smtp.gmail.com with ESMTPSA id b10sm2716191wrf.68.2021.10.14.09.37.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 14 Oct 2021 09:37:24 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <83ilyqtqzc.fsf@HIDDEN> <87zgrbhau7.fsf@HIDDEN>
 <838ryvlhov.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 17:37:23 +0100
In-Reply-To: <838ryvlhov.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 14 Oct
 2021 12:01:07 -0400")
Message-ID: <87wnmf5zr0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, alan@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii [2021-10-14 12:01 -0400] wrote:

>> From: "Basil L. Contovounesios" <contovob@HIDDEN>
>> Cc: Alan Third <alan@HIDDEN>,  50767 <at> debbugs.gnu.org
>> Date: Thu, 14 Oct 2021 16:42:24 +0100
>> 
>> > AFAIR, there's no need to check the return value of xmalloc, because
>> > it doesn't return if it cannot allocate memory.
>> 
>> Are you thinking about xalloc?
>
> No, I'm thinking xmalloc.
>
>> If not, could you please point me to the part of xmalloc that
>> doesn't return (except for the !initialized branch in memory_full)?
>> I'm afraid I couldn't spot it.
>
> This part:
>
>   if (!val && size)
>     memory_full (size);

Sorry, I thought xsignal in memory_full would return, because I confused
it with nonlocal exits in dynamic modules which do.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Oct 2021 16:01:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 12:01:16 2021
Received: from localhost ([127.0.0.1]:36901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb3AS-0004WY-Cx
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:01:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53312)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mb3AO-0004WC-UR
 for 50767 <at> debbugs.gnu.org; Thu, 14 Oct 2021 12:01:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52730)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mb3AH-00078u-WD; Thu, 14 Oct 2021 12:01:06 -0400
Received: from [87.69.77.57] (port=2512 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mb3A3-0003zt-7K; Thu, 14 Oct 2021 12:00:57 -0400
Date: Thu, 14 Oct 2021 19:00:48 +0300
Message-Id: <838ryvlhov.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
In-Reply-To: <87zgrbhau7.fsf@HIDDEN> (contovob@HIDDEN)
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <83ilyqtqzc.fsf@HIDDEN> <87zgrbhau7.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, alan@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: "Basil L. Contovounesios" <contovob@HIDDEN>
> Cc: Alan Third <alan@HIDDEN>,  50767 <at> debbugs.gnu.org
> Date: Thu, 14 Oct 2021 16:42:24 +0100
> 
> > AFAIR, there's no need to check the return value of xmalloc, because
> > it doesn't return if it cannot allocate memory.
> 
> Are you thinking about xalloc?

No, I'm thinking xmalloc.

> If not, could you please point me to the part of xmalloc that
> doesn't return (except for the !initialized branch in memory_full)?
> I'm afraid I couldn't spot it.

This part:

  if (!val && size)
    memory_full (size);




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Oct 2021 15:43:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 11:43:15 2021
Received: from localhost ([127.0.0.1]:36834 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb2t1-0003yP-Dv
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 11:43:15 -0400
Received: from mail-wr1-f47.google.com ([209.85.221.47]:46026)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mb2sz-0003yC-4m
 for 50767 <at> debbugs.gnu.org; Thu, 14 Oct 2021 11:43:14 -0400
Received: by mail-wr1-f47.google.com with SMTP id r10so20752378wra.12
 for <50767 <at> debbugs.gnu.org>; Thu, 14 Oct 2021 08:43:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=WEjoDquvx3p+LQ5QANSCVeKpwiNu6UbvvNcTxkXUTog=;
 b=O5LEB9xwXwn/GIMZODqItbrDtApEAyH//L5OT8ak8J+C6I2HPzVuuZKtZP4YT1Zcjm
 9TyKiF5C7RhvQ3l9OvWe5M9QjhEkkCcScIFiNwVPdYV4+BX49KmBbA4M96aG3wDQjmvX
 7IJ3IT2PpyJKPI+IZT6xA0Fd1WRE1HjqftaNJUKhvIb2zByt5BhLge6FSVVfrCiW9d7q
 m28aNl59x9LNYC905BqHQEGDRy83c6RrWPXJ6mRcTeMN4neNDNRqI4p/twSDFFXQfzoe
 vycwYFqT/CEvCpcBYATnJHIgYbwBOjEIPWF+RS29gc5/qM0bBnTbtuUqAn3c9ipIZxKQ
 +MMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=WEjoDquvx3p+LQ5QANSCVeKpwiNu6UbvvNcTxkXUTog=;
 b=NDK66KDbDGc2gDVNLuPpEFIPmpDZoZFl19OfQLBn/vN213+6Jw6i71zzRZjSph4aYF
 FmF7TzPMfQjJERzGKmR6HR4q+inKwCfAcT9TXGKQ0144cM8s1oXRLcDJkr5eh8/uFvIO
 E+JR/lQxI2vJr40eHLc3zxudNkcoQzPPyssmDtME0y5o73sOqztYcNCSjK1KWZfoIifm
 Bhf+kWvGTd2KMa64eU8vbk82agIdrAGC69tAbpMogunYtk3A6DiTrofquDZoY5nGjVUr
 EosdBhYgvJL7ddp3003ROQLmARjdxAXMyfI6I/lwYmKrGtXFGTvFCTw4U4wNbXxecFpy
 zNrQ==
X-Gm-Message-State: AOAM532fpbgnFSaBYYoONiGq7TAzaf9IdfNmk6w398oAUdpkmn13xr/v
 8joGB2ACwbsIVVunFCdnNqHUeQNRLT6Nzg==
X-Google-Smtp-Source: ABdhPJyuVlfhSKWxHp0FvT2uKcGic/Jhox1fLCHTWT5WLRUE2dETlZdSwYB//e8iMinQrkBGK+rJpg==
X-Received: by 2002:adf:c78d:: with SMTP id l13mr7509338wrg.134.1634226187200; 
 Thu, 14 Oct 2021 08:43:07 -0700 (PDT)
Received: from localhost ([89.101.154.41])
 by smtp.gmail.com with ESMTPSA id g1sm9232579wmk.2.2021.10.14.08.43.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 14 Oct 2021 08:43:06 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Alan Third <alan@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <YVt14vgxHY4IM3Q4@HIDDEN>
Date: Thu, 14 Oct 2021 16:43:05 +0100
In-Reply-To: <YVt14vgxHY4IM3Q4@HIDDEN> (Alan Third's message of "Mon, 4
 Oct 2021 22:45:06 +0100")
Message-ID: <87wnmfhat2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Third [2021-10-04 22:45 +0100] wrote:

> On Thu, Sep 23, 2021 at 11:49:37PM +0100, Alan Third wrote:
>> On Thu, Sep 23, 2021 at 11:38:06PM +0100, Basil L. Contovounesios wrote:
>> > ...which would mean this only holds in the common case that
>> > face_font_size has fewer than 5 digits, right?
>> 
>> Looks that way.
>> 
>> I suppose in this particular case we could limit the font size to a
>> maximum of 9999 or something, but surely there's a better way of
>> calculating string sizes?
>
> I've implemented a pretty basic check so we shouldn't accidentally
> overrun the buffer. See attached.

Thanks, and sorry for the late reply.  I haven't had a chance to compile
this on armv7l yet, but I should be able to later today or tomorrow.  It
continues to compile without warnings on x86_64.

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 14 Oct 2021 15:42:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 14 11:42:37 2021
Received: from localhost ([127.0.0.1]:36829 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mb2sP-0003xA-3W
	for submit <at> debbugs.gnu.org; Thu, 14 Oct 2021 11:42:37 -0400
Received: from mail-wr1-f50.google.com ([209.85.221.50]:39540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mb2sK-0003wu-RD
 for 50767 <at> debbugs.gnu.org; Thu, 14 Oct 2021 11:42:35 -0400
Received: by mail-wr1-f50.google.com with SMTP id r18so20886134wrg.6
 for <50767 <at> debbugs.gnu.org>; Thu, 14 Oct 2021 08:42:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=iGjLVqpMzUvyWX9iRXVjWImASDKje6jKMK1cRE9meHE=;
 b=E6B3XCmydD+11Jhb+qWxd4ei8j5tgsNVoW8zZP0oTPpX0FrF9Zz2DYx7AUj/M5Qimd
 W+Y0VVLdwENbi9GkxKM0lS5lm8ke/4EZILrknTUTO/eWRkUIYOL9nRFqV74uEuMzgzHN
 CoIitGcjLtHdjmxSKfkq7PCi4Fqb+bLD8vpCzASKlTt21AhbzYiq1yFfakz+4pnq55je
 WSKIhn4gYCuex1rZvhGg5ek4+oWx1gAAfJxBGZ9Zfh4+/c3tDbNJsSKpCf/QCQhGNlC4
 DgBcRwm4YY3ILyxCJx3Y0NWKZrlGhGwv5uUv4NETvyYo9v7f9qLSgPuzgg6XZ1iLVJlQ
 pBNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=iGjLVqpMzUvyWX9iRXVjWImASDKje6jKMK1cRE9meHE=;
 b=bsSq5B22F1iYDco2RV3qSHUBLXgst3uEO//BMBTWRGkiUsQNhljYZjnOxbAVknc7EC
 OR5M9/IFjKcnc9H3BKogzqCAoJYu3tEdsm+2yL4J6KNJog29ZAMTmqRAmqTK21I6cuXS
 O0TB6vPUctKkK8Fqwy3pmq7Ozut9yoiM/NgtTBCB6T76f/pJXHAoKdz6aQYxZBO95ERt
 uxJX6wJ4+UmAhe2UM46Sb0dwwQ/E7QcBhuZRUWnKrWxVzvqBbuVer6a/n5JRjtnpTa1Q
 WaNx+stVXku3eF1UoOfcWS7JS2+73qYNvx+lHODx1xS/LvZZ3B8pnSzyiPfatwxWExhM
 5jpg==
X-Gm-Message-State: AOAM533pCnDs6ttswvRZNWYhVYqdoAeZpWUD9Fm6JcFcnuV+k1E0D3wE
 EoFCnRcoBe+83MyjVbD5O7KgtA==
X-Google-Smtp-Source: ABdhPJz6LitAkgDqT/pzSbDE16g5pKscqhmIFO40NFPNuT02+nduTPLjEZ7sNrv7qBFDY92VGibchQ==
X-Received: by 2002:a05:600c:4f08:: with SMTP id
 l8mr6535486wmq.47.1634226146682; 
 Thu, 14 Oct 2021 08:42:26 -0700 (PDT)
Received: from localhost ([89.101.154.41])
 by smtp.gmail.com with ESMTPSA id q16sm2907090wru.39.2021.10.14.08.42.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 14 Oct 2021 08:42:25 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
 <83ilyqtqzc.fsf@HIDDEN>
Date: Thu, 14 Oct 2021 16:42:24 +0100
In-Reply-To: <83ilyqtqzc.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 24 Sep
 2021 09:41:43 +0300")
Message-ID: <87zgrbhau7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org, Alan Third <alan@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii [2021-09-24 09:41 +0300] wrote:

>> Date: Thu, 23 Sep 2021 23:49:37 +0100
>> From: Alan Third <alan@HIDDEN>
>> Cc: 50767 <at> debbugs.gnu.org
>> 
>> > >> What if xmalloc or snprintf fail?
>> > >
>> > > Doesn't xmalloc causes some sort of error to occur? I'm not sure.
>> > 
>> > I think it exits only while Emacs is still initialising itself before
>> > entering the top-level command loop, and otherwise frees ballast memory
>> > and signals a Lisp error.
>> > 
>> > At least the second snprintf in svg_load_image does check xmalloc's
>> > return value.
>> 
>> None of the other uses of xmalloc in image.c check the return value
>> either, as far as I can see, and I certainly didn't write them all...
>
> AFAIR, there's no need to check the return value of xmalloc, because
> it doesn't return if it cannot allocate memory.

Are you thinking about xalloc?  If not, could you please point me to the
part of xmalloc that doesn't return (except for the !initialized branch
in memory_full)?  I'm afraid I couldn't spot it.

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.
Added tag(s) patch. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 4 Oct 2021 21:45:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 17:45:19 2021
Received: from localhost ([127.0.0.1]:38503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXVlu-0004LM-OB
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 17:45:19 -0400
Received: from outbound.soverin.net ([116.202.126.228]:53825)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mXVls-0004L3-RN
 for 50767 <at> debbugs.gnu.org; Mon, 04 Oct 2021 17:45:17 -0400
Received: from smtp.soverin.net (unknown [10.10.3.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id DCCB192;
 Mon,  4 Oct 2021 21:45:09 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1633383909; bh=9LzUXrOpSo9WShzpnO+ffTb2tLex7kjqv7S1jZX3o1w=;
 h=Date:From:To:Subject:References:In-Reply-To:From;
 b=J5kL3xgAxwORNzBvomOjQORo+EpjuFuYzsgfdL7Ljn+2yc7XcKfBGubDU45FKNEjE
 69NzTdZqk61BSyVpOeqeJccv36FPOgcBrtM//HpZONrQKlG49gnZRW8+v4rhgnO+9/
 Rlh3MW1QGmoO2vZI2342vPJwX51niOrIAevF9KJdxRB1XFnUXUFk8RtBtoMd/a149H
 ujCOoVlS9NQzVD9rshLP5ZqvsqQP9qQ9CLX3h+bo2QbJs6QRm21TWOyBdgXoJPITsO
 qM8ehu8bP/xo4BuSUEEi3I52HUmLjCET3StUHhMOyzOqPNfJUiyrMUUSvEy9h2xDYB
 shdzpBi6/JJAg==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mXVli-000ZIv-Hl;
 Mon, 04 Oct 2021 22:45:06 +0100
Date: Mon, 4 Oct 2021 22:45:06 +0100
From: Alan Third <alan@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YVt14vgxHY4IM3Q4@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="vA2EH+GlmNsUs+tM"
Content-Disposition: inline
In-Reply-To: <YU0EgZuq4OuT8mTe@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--vA2EH+GlmNsUs+tM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Sep 23, 2021 at 11:49:37PM +0100, Alan Third wrote:
> On Thu, Sep 23, 2021 at 11:38:06PM +0100, Basil L. Contovounesios wrote:
> > ...which would mean this only holds in the common case that
> > face_font_size has fewer than 5 digits, right?
> 
> Looks that way.
> 
> I suppose in this particular case we could limit the font size to a
> maximum of 9999 or something, but surely there's a better way of
> calculating string sizes?

I've implemented a pretty basic check so we shouldn't accidentally
overrun the buffer. See attached.

-- 
Alan Third

--vA2EH+GlmNsUs+tM
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="0001-Fix-potential-buffer-overflow-bug-50767.patch"

From 1b2ffac09c184ebc58921f2b48eacc3629596cdb Mon Sep 17 00:00:00 2001
From: Alan Third <alan@HIDDEN>
Date: Mon, 4 Oct 2021 22:35:41 +0100
Subject: [PATCH] Fix potential buffer overflow (bug#50767)

* src/image.c (svg_load_image): Check how many bytes were actually
written to the buffer.  Don't check xmalloc return value as xmalloc
doesn't return if it fails.
---
 src/image.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/image.c b/src/image.c
index 206c7baa2f..49b26301e8 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9996,10 +9996,16 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
   if (!STRINGP (lcss))
     {
       /* Generate the CSS for the SVG image.  */
-      const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}";
-      int css_len = strlen (css_spec) + strlen (img->face_font_family);
+      /* FIXME: The below calculations leave enough space for a font
+	 size up to 9999, if it overflows we just throw an error but
+	 should probably increase the buffer size.  */
+      const char *css_spec = "svg{font-family:\"%s\";font-size:%dpx}";
+      int css_len = strlen (css_spec) + strlen (img->face_font_family) + 1;
       css = xmalloc (css_len);
-      snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size);
+      if (css_len <= snprintf (css, css_len, css_spec,
+			       img->face_font_family, img->face_font_size))
+	goto rsvg_error;
+
       rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL);
     }
   else
@@ -10157,12 +10163,11 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
 
     wrapped_contents = xmalloc (buffer_size);
 
-    if (!wrapped_contents
-        || buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper,
-                                    foreground & 0xFFFFFF, width, height,
-                                    viewbox_width, viewbox_height,
-                                    background & 0xFFFFFF,
-                                    SSDATA (encoded_contents)))
+    if (buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper,
+				 foreground & 0xFFFFFF, width, height,
+				 viewbox_width, viewbox_height,
+				 background & 0xFFFFFF,
+				 SSDATA (encoded_contents)))
       goto rsvg_error;
 
     wrapped_size = strlen (wrapped_contents);
-- 
2.33.0


--vA2EH+GlmNsUs+tM--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 24 Sep 2021 06:41:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 24 02:41:56 2021
Received: from localhost ([127.0.0.1]:56514 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTeuC-00019D-M2
	for submit <at> debbugs.gnu.org; Fri, 24 Sep 2021 02:41:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43190)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mTeuB-00018z-Pm
 for 50767 <at> debbugs.gnu.org; Fri, 24 Sep 2021 02:41:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45304)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mTeu5-0004jb-LX; Fri, 24 Sep 2021 02:41:49 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3321
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mTeu5-00080V-8S; Fri, 24 Sep 2021 02:41:49 -0400
Date: Fri, 24 Sep 2021 09:41:43 +0300
Message-Id: <83ilyqtqzc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Third <alan@HIDDEN>
In-Reply-To: <YU0EgZuq4OuT8mTe@HIDDEN> (message from Alan Third on Thu, 23
 Sep 2021 23:49:37 +0100)
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50767
Cc: contovob@HIDDEN, 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 23 Sep 2021 23:49:37 +0100
> From: Alan Third <alan@HIDDEN>
> Cc: 50767 <at> debbugs.gnu.org
> 
> > >> What if xmalloc or snprintf fail?
> > >
> > > Doesn't xmalloc causes some sort of error to occur? I'm not sure.
> > 
> > I think it exits only while Emacs is still initialising itself before
> > entering the top-level command loop, and otherwise frees ballast memory
> > and signals a Lisp error.
> > 
> > At least the second snprintf in svg_load_image does check xmalloc's
> > return value.
> 
> None of the other uses of xmalloc in image.c check the return value
> either, as far as I can see, and I certainly didn't write them all...

AFAIR, there's no need to check the return value of xmalloc, because
it doesn't return if it cannot allocate memory.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 23 Sep 2021 22:59:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 18:59:33 2021
Received: from localhost ([127.0.0.1]:56221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTXgi-0005Hd-Qx
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:59:32 -0400
Received: from outbound.soverin.net ([116.202.126.228]:39847)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mTXgh-0005HM-0V
 for 50767 <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:59:31 -0400
Received: from smtp.soverin.net (unknown [10.10.3.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id BA80BE3;
 Thu, 23 Sep 2021 22:59:24 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1632437964; bh=obA+HTpHcvhAHXyU7EGHtSmTfHRaBgD2/Qfz4vdF4AE=;
 h=Date:From:To:Subject:References:In-Reply-To:From;
 b=PIxTvhdeeL/UeM/Hj4G312MGjmcU4S2f7asuo1TXk6aWkiJJ09/Oy3GZfi8SoXUMb
 gc/vCY5C2MHKd7QTCsN0ZyeGXCd2HK1wF0vTbXkSgknx+VWJ7ziaW8EpylW2dPKaBL
 SLDx8u3GIUaGJBdx/GOuplbCbCDvlR0ikQKTZSKWFQFXSMPFrPBn0fdvtCTaIMMVBk
 FeiS7du5LhBGMFdikYjsbpuvQzd64TIClUMAk2uWWsnoZmjZgc31D42rt16dwVWw8k
 gOXhoLjyNsbEAKaSe07UPHfCFzPB4Xy2/u3VYq3LQ1vuM239CPEnAWb/IJTCIFYFwP
 NKtelkesOujTg==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mTXgX-0006G0-Se;
 Thu, 23 Sep 2021 23:59:21 +0100
Date: Thu, 23 Sep 2021 23:59:21 +0100
From: Alan Third <alan@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YU0GyVV/jXQwzzBL@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN> <YU0EgZuq4OuT8mTe@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <YU0EgZuq4OuT8mTe@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Thu, Sep 23, 2021 at 11:49:37PM +0100, Alan Third wrote:
> 
> I suppose in this particular case we could limit the font size to a
> maximum of 9999 or something, but surely there's a better way of
> calculating string sizes?

Oh, can we just use Fformat and skip all of this stuff?
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 23 Sep 2021 22:49:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 18:49:51 2021
Received: from localhost ([127.0.0.1]:56214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTXXK-000527-Qi
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:49:51 -0400
Received: from outbound.soverin.net ([116.202.126.228]:45263)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mTXXH-00051q-RX
 for 50767 <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:49:48 -0400
Received: from smtp.soverin.net (unknown [10.10.3.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 95A0DE3;
 Thu, 23 Sep 2021 22:49:41 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1632437380; bh=RA5dK9zMlVx+eyjpc3vwGqxEeD9HXG9yz42/pY2fEgc=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=QIy6oYfvGPCk4Xo0dtIiOg/yLkv6zfJuoPGO9XauMXlJn+7OyQ7Dl1Yl2B9yMbDzI
 Eei1ndcyOHM3DodAy1mZ+EaVmw8hOHK3E32cZDylIZhROR0k/7+c21bttDKslKN/jr
 gjKv76a/ekyj4vaZsG8kHdlXomVolUcAnLpL8vuuOrK8JIBLK3EqCyKgpGgZ1WlJJu
 9LvsgxK+yj2xxHIf9oxtSRXGIbbuTRzRzdkU1caT36MaGOE2gIy6n1I7KWd1UX03Pe
 l3qX4bHQfdLbaE19AtbacadaLx1Sw4NXVjdRuZuvO6beBEHkgFhed5d2I6u76DIEVL
 Ev5DFYAz5N3cA==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mTXX7-0006AB-FK;
 Thu, 23 Sep 2021 23:49:37 +0100
Date: Thu, 23 Sep 2021 23:49:37 +0100
From: Alan Third <alan@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YU0EgZuq4OuT8mTe@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
 <878rzmuddd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <878rzmuddd.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Thu, Sep 23, 2021 at 11:38:06PM +0100, Basil L. Contovounesios wrote:
> Alan Third [2021-09-23 22:46 +0100] wrote:
> 
> > On Thu, Sep 23, 2021 at 06:04:12PM +0100, Basil L. Contovounesios via Bug
> > reports for GNU Emacs, the Swiss army knife of text editors wrote:
> >>
> >> > const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}";
> >> 
> >> Why specifically '%4d' for face_font_size?
> >
> > I figured it unlikely that anyone would be using a font size of 10000
> > pixels or larger and I wanted to set an upper limit on the string size.
> 
> AFAIK %d does not truncate numbers with more digits than the specified
> width or precision...

Hmm, I guess so.

> >> > int css_len = strlen (css_spec) + strlen (img->face_font_family);
> >> > css = xmalloc (css_len);
> >> > snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size);
> >> > rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL);
> >> 
> >> Does css_len not need to include the terminating null byte?
> >
> > It does. If you add up the length of the spec string which includes
> > the escape codes, and the length of the font name, then if the font
> > size does produce it's maximum sized string of 4 characters css_len is
> > exactly one byte larger than the string length.
> 
> ...which would mean this only holds in the common case that
> face_font_size has fewer than 5 digits, right?

Looks that way.

I suppose in this particular case we could limit the font size to a
maximum of 9999 or something, but surely there's a better way of
calculating string sizes?

> >> What if xmalloc or snprintf fail?
> >
> > Doesn't xmalloc causes some sort of error to occur? I'm not sure.
> 
> I think it exits only while Emacs is still initialising itself before
> entering the top-level command loop, and otherwise frees ballast memory
> and signals a Lisp error.
> 
> At least the second snprintf in svg_load_image does check xmalloc's
> return value.

None of the other uses of xmalloc in image.c check the return value
either, as far as I can see, and I certainly didn't write them all...
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 23 Sep 2021 22:38:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 18:38:17 2021
Received: from localhost ([127.0.0.1]:56198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTXM8-0004h1-O3
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:38:16 -0400
Received: from mail-wr1-f45.google.com ([209.85.221.45]:37680)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mTXM6-0004gn-PM
 for 50767 <at> debbugs.gnu.org; Thu, 23 Sep 2021 18:38:15 -0400
Received: by mail-wr1-f45.google.com with SMTP id t8so21606161wrq.4
 for <50767 <at> debbugs.gnu.org>; Thu, 23 Sep 2021 15:38:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=0fAh9SMcwdObOpyz3tE0DGV+GWIqqDBAUJi3BKPEQQg=;
 b=F+uSinm7ydNdAUi0T7/1JkgZC8L9b8WpV6CtL3yQOcMHU38ZVQooLXCFlJXmVb1VRv
 qnK4Oxtj0L6QwvSD+sCWQct0Oz2M9FV/8PISyYAorQCr8mhYlwY3v/B6T6uiMdb3mEd2
 f8e7mkCl0AZyZq9V6+5hu6+GgH41FDESp74ipoV+fIssLj9r4BmEQWgI0Ot02GbS/F6z
 nXYGOxhzjRXiQEV8x6fG7fwY6+RTy1wH1GTxFUIuxWyyL4NBEhEqZEmoT7vNO/1ktc5H
 luJd2l6m5IVNO0Sy8vfIKBFWIyFQl+AVKQ5C0uWVorAMkbty8keqxqdqIMoKNLRXwEQs
 lMTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=0fAh9SMcwdObOpyz3tE0DGV+GWIqqDBAUJi3BKPEQQg=;
 b=2/gG4yWD9q/DzlQT/H3cXo1mgDEnTHNg5QEbxGUdLPJKanXV1jXqxZwTCjmAeDUchx
 J1X7KfyyJ0pGezPlDkydfhJluDVeasbB8XV7U/4iJDuXe+tObuo9N765VFUfLHzsTnJy
 44ZPpIlRj4nIZQn8P/rdKEEsCOzPiETe/m0A1khoTPF7cycMf7yOrgLBsI7ocQSQQko1
 Su4pnHZBA4fh8yxCR6vtiAmGHKjjTjzzhbKisc+ksTi//benizzyg9cngA59K3lCZr46
 cDQh2ry8Z7mOypRieXPENNJZYeL4pvzKoPECiuI2ys9XBXg/CZ56J45iooWNi35AwLOM
 QjeQ==
X-Gm-Message-State: AOAM532BPskw0Xjq/90VagLM8TSQrngyoghyrI+BR7ARFBIFVI7DTtqs
 N4aadtEwceYEtGvhIKMtzL+xzA==
X-Google-Smtp-Source: ABdhPJxMWiLkUKbpebjm0fuI7n91UvzCTgIiY4TdWE8MDGdf1zYHf2vtsClsZxIulxNyIb8W3pym4w==
X-Received: by 2002:a5d:6da9:: with SMTP id u9mr7975435wrs.58.1632436688687;
 Thu, 23 Sep 2021 15:38:08 -0700 (PDT)
Received: from localhost ([2a02:8084:20e2:c380:f410:82e8:3a21:eedf])
 by smtp.gmail.com with ESMTPSA id c77sm6475650wme.46.2021.09.23.15.38.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 23 Sep 2021 15:38:08 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: Alan Third <alan@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
References: <87zgs3te9f.fsf@HIDDEN> <YUz1wURwdT30l/VB@HIDDEN>
Date: Thu, 23 Sep 2021 23:38:06 +0100
In-Reply-To: <YUz1wURwdT30l/VB@HIDDEN> (Alan Third's message of "Thu, 23
 Sep 2021 22:46:41 +0100")
Message-ID: <878rzmuddd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Third [2021-09-23 22:46 +0100] wrote:

> On Thu, Sep 23, 2021 at 06:04:12PM +0100, Basil L. Contovounesios via Bug
> reports for GNU Emacs, the Swiss army knife of text editors wrote:
>>
>> > const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}";
>> 
>> Why specifically '%4d' for face_font_size?
>
> I figured it unlikely that anyone would be using a font size of 10000
> pixels or larger and I wanted to set an upper limit on the string size.

AFAIK %d does not truncate numbers with more digits than the specified
width or precision...

>> > int css_len = strlen (css_spec) + strlen (img->face_font_family);
>> > css = xmalloc (css_len);
>> > snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size);
>> > rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL);
>> 
>> Does css_len not need to include the terminating null byte?
>
> It does. If you add up the length of the spec string which includes
> the escape codes, and the length of the font name, then if the font
> size does produce it's maximum sized string of 4 characters css_len is
> exactly one byte larger than the string length.

...which would mean this only holds in the common case that
face_font_size has fewer than 5 digits, right?

>> What if xmalloc or snprintf fail?
>
> Doesn't xmalloc causes some sort of error to occur? I'm not sure.

I think it exits only while Emacs is still initialising itself before
entering the top-level command loop, and otherwise frees ballast memory
and signals a Lisp error.

At least the second snprintf in svg_load_image does check xmalloc's
return value.

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at 50767 <at> debbugs.gnu.org:


Received: (at 50767) by debbugs.gnu.org; 23 Sep 2021 21:46:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 17:46:55 2021
Received: from localhost ([127.0.0.1]:56123 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTWYQ-0000XV-Pk
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 17:46:55 -0400
Received: from outbound.soverin.net ([116.202.126.228]:58363)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alan@HIDDEN>) id 1mTWYO-0000RB-Fe
 for 50767 <at> debbugs.gnu.org; Thu, 23 Sep 2021 17:46:53 -0400
Received: from smtp.soverin.net (unknown [10.10.3.24])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
 (No client certificate requested)
 by outbound.soverin.net (Postfix) with ESMTPS id 3C189E3;
 Thu, 23 Sep 2021 21:46:45 +0000 (UTC)
Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by
 soverin.net
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin;
 t=1632433604; bh=h5a4TzZvtq+eSnxNmsHkoVl49hN7pySWGqneeVok00M=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=DNqRdt2JX5h5yRDBaRld4Sp0zCVFVUxG+QF8XaBs88aGQZpC3RzaVZQpH4DwpiAUZ
 if7vzylVyfiNZ4uGu/zwlrwQ5d/no2r1euqrV5N3vG1g1mVck4RHaoDzzPuFcKRIPW
 R8lsOD4fkFmIcLEK7jTjft8KyWPlFuxkQiinF5Uvy2qA1kZUv2I5NWK8HKi0dvoaiZ
 ZYW2kLFBOnph9/5K2IzmDx3UdWN6TMPhEyUX1x4DaNRVDCtRgOa0tfFaZ0sh2MeYIO
 SWZe0fVfX8ra1DffpsZTV4vwz8UKOfVdFqsSiNn+MzNHioII1BjezpcRO8tyNJg63+
 Nj0nuSbx5DKEQ==
Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2)
 (envelope-from <alan@HIDDEN>) id 1mTWYD-0005hv-IM;
 Thu, 23 Sep 2021 22:46:41 +0100
Date: Thu, 23 Sep 2021 22:46:41 +0100
From: Alan Third <alan@HIDDEN>
To: "Basil L. Contovounesios" <contovob@HIDDEN>
Subject: Re: bug#50767: 28.0.50; Warnings about snprintf in image.c on armv7l
Message-ID: <YUz1wURwdT30l/VB@HIDDEN>
Mail-Followup-To: Alan Third <alan@HIDDEN>,
 "Basil L. Contovounesios" <contovob@HIDDEN>, 50767 <at> debbugs.gnu.org
References: <87zgs3te9f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87zgs3te9f.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50767
Cc: 50767 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Thu, Sep 23, 2021 at 06:04:12PM +0100, Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
> Severity: minor
> 
> Compiling image.c on a 32-bit armv7l host gives the following warnings:
> 
> --8<---------------cut here---------------start------------->8---
> image.c: In function ‘svg_load_image’:
> image.c:9999:64: warning: ‘%4d’ directive output may be truncated writing between 4 and 11 bytes
>                  into a region of size between 7 and 8 [-Wformat-truncation=]
>  9999 |       const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}";
>       |                                                                ^~~
> image.c:10002:7: note: ‘snprintf’ output 37 or more bytes (assuming 38) into a destination of size 37
> 10002 |       snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size);
>       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> image.c:10134:7: warning: ‘%f’ directive output may be truncated writing between 3 and 317 bytes
>                  into a region of size between 167 and 187 [-Wformat-truncation=]
> 10134 |       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
>       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> image.c:10138:22: note: format string is defined here
> 10138 |       "viewBox=\"0 0 %f %f\">"
>       |                      ^~
> image.c:10134:7: note: assuming directive output of 8 bytes
> 10134 |       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
>       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> image.c:10134:7: note: assuming directive output of 8 bytes
> image.c:10134:7: note: directive argument in the range [0, 16777215]
> image.c:10134:7: note: assuming directive output of 1 byte
> image.c:10161:27: note: ‘snprintf’ output 320 or more bytes (assuming 331) into a destination of size 383
> 10161 |         || buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper,
>       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10162 |                                     foreground & 0xFFFFFF, width, height,
>       |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10163 |                                     viewbox_width, viewbox_height,
>       |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 10164 |                                     background & 0xFFFFFF,
>       |                                     ~~~~~~~~~~~~~~~~~~~~~~
> 10165 |                                     SSDATA (encoded_contents)))
>       |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~
> --8<---------------cut here---------------end--------------->8---
> 
> What's TRT to do?  Call snprintf twice, the first time to calculate the
> required buffer size?  Calculate more precisely the resulting size of
> each argument?  Inhibit the warnings?  Something else?

This is my code and I'm not sure, which is why there's a FIXME in
there somewhere about it.

> Some questions about the current code:
> 
> > const char *css_spec = "svg{font-family:\"%s\";font-size:%4dpx}";
> 
> Why specifically '%4d' for face_font_size?

I figured it unlikely that anyone would be using a font size of 10000
pixels or larger and I wanted to set an upper limit on the string size.

> > int css_len = strlen (css_spec) + strlen (img->face_font_family);
> > css = xmalloc (css_len);
> > snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_size);
> > rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NULL);
> 
> Does css_len not need to include the terminating null byte?

It does. If you add up the length of the spec string which includes
the escape codes, and the length of the font name, then if the font
size does produce it's maximum sized string of 4 characters css_len is
exactly one byte larger than the string length.

> What if xmalloc or snprintf fail?

Doesn't xmalloc causes some sort of error to occur? I'm not sure. If
snprintf fails then I believe we should end up with an invalid CSS
stylesheet and librsvg will ignore it.

Perhaps there's a worse failure mode that I'm missing.

> > css = xmalloc (SBYTES (lcss) + 1);
> > strncpy (css, SSDATA (lcss), SBYTES (lcss));
> > *(css + SBYTES (lcss) + 1) = 0;
> 
> Can this be replaced with xlispstrdup?

Probably.
-- 
Alan Third




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Sep 2021 17:04:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 23 13:04:34 2021
Received: from localhost ([127.0.0.1]:55726 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mTS9B-0007dS-Ln
	for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 13:04:34 -0400
Received: from lists.gnu.org ([209.51.188.17]:55726)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <contovob@HIDDEN>) id 1mTS99-0007dI-GZ
 for submit <at> debbugs.gnu.org; Thu, 23 Sep 2021 13:04:32 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41182)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <contovob@HIDDEN>) id 1mTS99-00031W-6q
 for bug-gnu-emacs@HIDDEN; Thu, 23 Sep 2021 13:04:31 -0400
Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:33356)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <contovob@HIDDEN>) id 1mTS94-0000Is-7a
 for bug-gnu-emacs@HIDDEN; Thu, 23 Sep 2021 13:04:30 -0400
Received: by mail-wr1-x431.google.com with SMTP id t18so19251899wrb.0
 for <bug-gnu-emacs@HIDDEN>; Thu, 23 Sep 2021 10:04:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21;
 h=from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=/T5r5iz/VLmRjXBtfR8h1bmKRqBQ5SUnCCYmWV7YuNc=;
 b=Jx8l/qBYnXyWoZYjb+kSjdiJlEP4Ltj95dTMP47kk3Z7DCuw77+TBsVbBlnNNIMkm/
 toEV9lo4/p+TBPAWY+TLPwP1H1CrEsDMrZVGlrzJmT9ijOLMfFSS4LFaPriTmGxAW/OO
 RZKseFnZAHrftVSjAV2DoL8OSxwFWSv8gRNZQb/SqTrvdQ4LFp2Qto7tse8SccNLeLI3
 ou5nvBy2/+z4mHVzVO5LFPDKsOMwc76Qxa6nG/5fmeAgjZLDxYcvDedKs4dadHP/su/o
 d3NWnzS0VitM4RYNWDn/nqQBKKbBEAPEoP0x81W1AH+j6U17zm4xEKknC9+HrVLksflE
 vurw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=/T5r5iz/VLmRjXBtfR8h1bmKRqBQ5SUnCCYmWV7YuNc=;
 b=RBATlAfyrxDjEDCkQlUtpo0rEoyCsXvOsYroJ/RCvJytSKSBpmO+tog3Ugd0bIzMEm
 m4zxz38ydDkoyA0AYJ6mOHWP3dmigtv7fWAdLSrZGeCINZ2/xjyLj7RrMfwoBeUZrfwi
 BvKC0zMQhYjl0XvO1rzPjE4flUQF6DiOPVydneBvV2mzbvA1lVb1y4e5WcMGGeIH4ulw
 qhfJIt/VkNb9LzdqUwb0IImHtezL0LtWdCceXrIvd6sqaFbP7oQqW0enxvbQj4BViOsI
 MQOR8kaYDs/EIY6ECvOQHKdJMAHUf4c0uCYqKaZO2xp3frvfBA1DbB0qjP8bYXAJCl9I
 z6pg==
X-Gm-Message-State: AOAM531h9o9ye35sVPKOe1JiF9GKcBYjQcS91B0fltYTvO710efTYSJb
 9FHrT6qSltdxlctC66XRQzuhJ76BjCvj3w==
X-Google-Smtp-Source: ABdhPJxf+SrGIfpzHUn4R7Ct/wQoLKNBd/4HkoHJSY3M+wKWWomtiPXntZvqt8RJ7inpxOIC+sFkUA==
X-Received: by 2002:adf:eec3:: with SMTP id a3mr6576965wrp.276.1632416663365; 
 Thu, 23 Sep 2021 10:04:23 -0700 (PDT)
Received: from localhost ([2a02:8084:20e2:c380:f410:82e8:3a21:eedf])
 by smtp.gmail.com with ESMTPSA id c135sm10075990wme.6.2021.09.23.10.04.22
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 23 Sep 2021 10:04:22 -0700 (PDT)
From: "Basil L. Contovounesios" <contovob@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Warnings about snprintf in image.c on armv7l
X-Debbugs-Cc: Alan Third <alan@HIDDEN>
Date: Thu, 23 Sep 2021 18:04:12 +0100
Message-ID: <87zgs3te9f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::431;
 envelope-from=contovob@HIDDEN; helo=mail-wr1-x431.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Severity: minor

Compiling image.c on a 32-bit armv7l host gives the following warnings:

--8<---------------cut here---------------start------------->8---
image.c: In function =E2=80=98svg_load_image=E2=80=99:
image.c:9999:64: warning: =E2=80=98%4d=E2=80=99 directive output may be tru=
ncated writing between 4 and 11 bytes
                 into a region of size between 7 and 8 [-Wformat-truncation=
=3D]
 9999 |       const char *css_spec =3D "svg{font-family:\"%s\";font-size:%4=
dpx}";
      |                                                                ^~~
image.c:10002:7: note: =E2=80=98snprintf=E2=80=99 output 37 or more bytes (=
assuming 38) into a destination of size 37
10002 |       snprintf (css, css_len, css_spec, img->face_font_family, img-=
>face_font_size);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~~~~~~~
image.c:10134:7: warning: =E2=80=98%f=E2=80=99 directive output may be trun=
cated writing between 3 and 317 bytes
                 into a region of size between 167 and 187 [-Wformat-trunca=
tion=3D]
10134 |       "<svg xmlns:xlink=3D\"http://www.w3.org/1999/xlink\" "
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image.c:10138:22: note: format string is defined here
10138 |       "viewBox=3D\"0 0 %f %f\">"
      |                      ^~
image.c:10134:7: note: assuming directive output of 8 bytes
10134 |       "<svg xmlns:xlink=3D\"http://www.w3.org/1999/xlink\" "
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image.c:10134:7: note: assuming directive output of 8 bytes
image.c:10134:7: note: directive argument in the range [0, 16777215]
image.c:10134:7: note: assuming directive output of 1 byte
image.c:10161:27: note: =E2=80=98snprintf=E2=80=99 output 320 or more bytes=
 (assuming 331) into a destination of size 383
10161 |         || buffer_size <=3D snprintf (wrapped_contents, buffer_size=
, wrapper,
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~
10162 |                                     foreground & 0xFFFFFF, width, h=
eight,
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~
10163 |                                     viewbox_width, viewbox_height,
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10164 |                                     background & 0xFFFFFF,
      |                                     ~~~~~~~~~~~~~~~~~~~~~~
10165 |                                     SSDATA (encoded_contents)))
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~
--8<---------------cut here---------------end--------------->8---

What's TRT to do?  Call snprintf twice, the first time to calculate the
required buffer size?  Calculate more precisely the resulting size of
each argument?  Inhibit the warnings?  Something else?

Some questions about the current code:

> const char *css_spec =3D "svg{font-family:\"%s\";font-size:%4dpx}";

Why specifically '%4d' for face_font_size?

> int css_len =3D strlen (css_spec) + strlen (img->face_font_family);
> css =3D xmalloc (css_len);
> snprintf (css, css_len, css_spec, img->face_font_family, img->face_font_s=
ize);
> rsvg_handle_set_stylesheet (rsvg_handle, (guint8 *)css, strlen (css), NUL=
L);

Does css_len not need to include the terminating null byte?

What if xmalloc or snprintf fail?

> css =3D xmalloc (SBYTES (lcss) + 1);
> strncpy (css, SSDATA (lcss), SBYTES (lcss));
> *(css + SBYTES (lcss) + 1) =3D 0;

Can this be replaced with xlispstrdup?

Thanks,

--=20
Basil

In GNU Emacs 28.0.50 (build 1, armv7l-unknown-linux-gnueabihf, X toolkit, c=
airo version 1.16.0, Xaw3d scroll bars)
 of 2021-09-23 built on raspberrypi
Repository revision: 90547d370f7c75b95b1d1e64b84e624e752ea6e3
Repository branch: master
System Description: Raspbian GNU/Linux 11 (bullseye)

Configured using:
 'configure 'CC=3Dccache gcc' 'CFLAGS=3D-O2 -march=3Dnative' --config-cache
 --prefix=3D/home/pi/.local --enable-checking=3Dstructs
 --with-x-toolkit=3Dlucid --with-file-notification=3Dyes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LC_ALL: en_IE.UTF-8
  value of $LANG: en_IE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils term/tmux term/xterm xterm
byte-opt gv bytecomp byte-compile cconv iso-transl tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
x multi-tty make-network-process emacs)

Memory information:
((conses 8 54179 7628)
 (symbols 24 6739 1)
 (strings 16 18259 2216)
 (string-bytes 1 596762)
 (vectors 8 10587)
 (vector-slots 4 130733 8726)
 (floats 8 24 229)
 (intervals 28 202 1)
 (buffers 576 10))




Acknowledgement sent to "Basil L. Contovounesios" <contovob@HIDDEN>:
New bug report received and forwarded. Copy sent to alan@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to alan@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#50767; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 15 Nov 2021 06:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.