From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qEeRLraCI2L/cQAAgWs5BA (envelope-from ) for ; Sat, 05 Mar 2022 16:33:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gBbVKraCI2IhhgAAauVa8A (envelope-from ) for ; Sat, 05 Mar 2022 16:33:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 705793CE93 for ; Sat, 5 Mar 2022 16:33:10 +0100 (CET) Received: from localhost ([::1]:44482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQWP6-0006Mt-VD for larch@yhetil.org; Sat, 05 Mar 2022 10:33:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQWP0-0006Mf-6o for guix-patches@gnu.org; Sat, 05 Mar 2022 10:33:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQWOz-0005B4-Uw for guix-patches@gnu.org; Sat, 05 Mar 2022 10:33:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nQWOz-0006ri-Q6 for guix-patches@gnu.org; Sat, 05 Mar 2022 10:33:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54252] [PATCH] gnu: lemonbar: Update to 1.4. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Mar 2022 15:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54252 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jai Vetrivelan , 54252@debbugs.gnu.org Received: via spool by 54252-submit@debbugs.gnu.org id=B54252.164649433526333 (code B ref 54252); Sat, 05 Mar 2022 15:33:01 +0000 Received: (at 54252) by debbugs.gnu.org; 5 Mar 2022 15:32:15 +0000 Received: from localhost ([127.0.0.1]:48868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQWOF-0006qf-Al for submit@debbugs.gnu.org; Sat, 05 Mar 2022 10:32:15 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:53746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQWOD-0006qW-JN for 54252@debbugs.gnu.org; Sat, 05 Mar 2022 10:32:13 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by albert.telenet-ops.be with bizsmtp id 2fYC270064UW6Th06fYCc9; Sat, 05 Mar 2022 16:32:12 +0100 Message-ID: <937e6a6666aee69ebf9377dd38144c5ebb4cdbe6.camel@telenet.be> From: Maxime Devos Date: Sat, 05 Mar 2022 16:32:11 +0100 In-Reply-To: <87h78c4knq.fsf@gmail.com> References: <87k0d953yg.fsf@gmail.com> <87h78c4knq.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-77Mcxhy3v7YpuFwFQbsI" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1646494332; bh=ToY6I/AlYJVqRmn73kRQHiivmGY4VWLFWPA4QUTPpFw=; h=Subject:From:To:Date:In-Reply-To:References; b=TIurHrfs0NkwOqJELnIVLmkaT7h/cMVqwieUze280PsHOlemoPTG0GJNfuelKbKin f8aJ/FcB7aDz0Kd+kjzuBDeArNO9V2x9a9a9gjPWTYTKvzSwBRQrcwoIiPgM+iuaPM +AQc34PVAZ5U4iy/bYDuGhjCP07WwLy3NVGfUPIBgO4cg7BFf6ReaqyZpQo5xeXjV4 gU1ws+EL9tZfCT7ZWiLbI5A4ZvLDVcM6S26tUbcEtG1ZF2dmvxxq+Wb9U+BqjJ9pt7 AOwpMtECVgai/9a5fKAQLItU1itZFjXkHhM931br1UAjJrWtaNwcOLk+MRnTn7OmH/ R3U+Q6+Lm/dGQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646494390; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=ToY6I/AlYJVqRmn73kRQHiivmGY4VWLFWPA4QUTPpFw=; b=owZZ1SEwz3W7YZ7J0iZl5pX6iCNtTwSx7CfExD7O6Dyr8wQCoRf3dUJlKrzccgGzoFRdhj SkP7ks0gS7/5hZw1dRiVuGZPToHGMTQHJsjzwtA241tZuo19ZK6M2FgZUtb/AVa0MIR14x dZ26PsUq0Pjuft69IZqOz1hcNFqpgZds1fYgEU8GuSC9GYrSDPUNOpsslhv8AHT6b85wAj GVpmbuad95KKJYu8nNXNa3Gj14SI9bp4rZPj9Kxog7t7hOCVB/SPB9jewKt3ikuWzP8Oc1 RwOH9PZBvvrz1AkuGZf5s6vr9YuMEdEUtRFaAQ2bbOzDchdAu4+7uuq0QiWTow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646494390; a=rsa-sha256; cv=none; b=IBtlfwbpIXg6IXWRqXADXS5k3ZRL0UehdbtrfUvQeKu5hOx1bVEWJeJgGD9w0v/Y820vJ1 BiL/ptZUc9g5Kf8rxxt0aW3xAAws6tTnFN0A/sQLdo5hnqfsBS3NOe1PxF3fKq2AEtb6Kv o6L+uXvnhiBz8wNemkzMMp6SJU5785RAsQaGn6qzUNKze2jnIeHSpRaKv041kQwwDZg9X/ i1b661k9ENKLYgwfnfGNztlUzaSdP+a70IMSOZjQB6h85ZF62IT3OodfA2xwoOfYWuhiQt jZshw4iWitBpqTMGV0HMGjHCE+iApsxdKPct7Ev1Pt2DT8QudQuOOg4rKSxFvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=TIurHrfs; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.76 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=TIurHrfs; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 705793CE93 X-Spam-Score: 2.76 X-Migadu-Scanner: scn0.migadu.com X-TUID: YQVNrfMy0EmH --=-77Mcxhy3v7YpuFwFQbsI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [Please keep 54252@debbugs.gnu.org in CC or To, such that other people can respond as well, such that discussion is not lost even if the original reviewers disappear, for transparancy reasons, etc.] Jai Vetrivelan schreef op za 05-03-2022 om 18:32 [+0530]: > Hello Maxime, >=20 > On 2022-03-05, 10:59 +0100, Maxime Devos wrote: >=20 > > At least in the 'master' branch (and presumably also in v1.4), there > > are a few bugs. At line 789, the return value of 'malloc' is not > > checked, potentially causing a null-pointer dereference (and hence, a > > segfault) at line 790 (in lemonbar.c). >=20 > Do you mean something like this? >=20 > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 diff --git a/lemonbar.c b/lemonbar.c > =E2=94=82 index 4da59ee..93fcb20 100644 > =E2=94=82 --- a/lemonbar.c > =E2=94=82 +++ b/lemonbar.c > =E2=94=82 @@ -785,8 +785,8 @@ font_load (const char *pattern) > =E2=94=82=20 > =E2=94=82 // Copy over the width lut as it's part of font_info > =E2=94=82 int lut_size =3D sizeof(xcb_charinfo_t) * xcb_query_font_c= har_infos_length(font_info); > =E2=94=82 - if (lut_size) { > =E2=94=82 - ret->width_lut =3D malloc(lut_size); > =E2=94=82 + ret->width_lut =3D malloc(lut_size); > =E2=94=82 + if (lut_size && ret->width_lut) { > =E2=94=82 memcpy(ret->width_lut, xcb_query_font_char_infos(font_= info), lut_size); > =E2=94=82 } > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 That just ignores the allocation failure, even though possibly the code will use ret->width_lut later, expecting it to be non-NULL (or maybe it actually handles NULL, I don't know). Probably the allocation failure needs to be reported (printf + exit, or return NULL, or something else). The exact mechanism used in C for handling allocation failures depends on the application. > > Could this be fixed? >=20 > I am not familiar with the C programming language, so I might not be > able to fix this. Ideally, things would be fixed upstream (it's on GitHub so you could try submitting a pull request). For Guix though, I believe simply reporting the potential issue upstream (at ) would be sufficient. Greetings, Maxime. --=-77Mcxhy3v7YpuFwFQbsI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYiOCexccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lvcAP4hPHtkU1xHJ40fsrcJKKkWi0b/ 3CDgS1aH27wAQPtltAD/aaFUtxm51znVFc7F6kLhNxp4rDli9GON3reM2DRGTg4= =VrXU -----END PGP SIGNATURE----- --=-77Mcxhy3v7YpuFwFQbsI--