From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ENYnBtMDIF+ZUAAA0tVLHw (envelope-from ) for ; Tue, 28 Jul 2020 10:54:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6LbrAdMDIF/1GQAAbx9fmQ (envelope-from ) for ; Tue, 28 Jul 2020 10:54:11 +0000 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 73647940654 for ; Tue, 28 Jul 2020 10:54:10 +0000 (UTC) Received: from localhost ([::1]:38814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0NFI-00017f-JZ for larch@yhetil.org; Tue, 28 Jul 2020 06:54:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0NFC-00017U-0I for bug-guix@gnu.org; Tue, 28 Jul 2020 06:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0NFB-0004yi-NV for bug-guix@gnu.org; Tue, 28 Jul 2020 06:54:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0NFB-0006xp-Ks for bug-guix@gnu.org; Tue, 28 Jul 2020 06:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40832: alsa-lib cannot find its plugins References: <20200424213727.GA11710@jasmine.lan> In-Reply-To: <20200424213727.GA11710@jasmine.lan> Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 28 Jul 2020 10:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40832 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40832@debbugs.gnu.org Received: via spool by 40832-submit@debbugs.gnu.org id=B40832.159593359726721 (code B ref 40832); Tue, 28 Jul 2020 10:54:01 +0000 Received: (at 40832) by debbugs.gnu.org; 28 Jul 2020 10:53:17 +0000 Received: from localhost ([127.0.0.1]:57395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0NES-0006wv-NM for submit@debbugs.gnu.org; Tue, 28 Jul 2020 06:53:16 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:34846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0NER-0006wm-49 for 40832@debbugs.gnu.org; Tue, 28 Jul 2020 06:53:16 -0400 Received: from localhost (80-110-127-146.cgn.dynamic.surfer.at [80.110.127.146]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 9C1453366D30 for <40832@debbugs.gnu.org>; Tue, 28 Jul 2020 12:53:13 +0200 (CEST) Date: Tue, 28 Jul 2020 12:52:41 +0200 From: Danny Milosavljevic Message-ID: <20200728125241.4ff41418@scratchpost.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/Txz4xBtVh+deZhNGdMRPbn7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.11 X-TUID: PJM5rEoTswfx --Sig_/Txz4xBtVh+deZhNGdMRPbn7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Leo, some comments on the lastest patch: * The entire alsa-lib seems to use the idiom "malloc and then strcpy", or "malloc and then sprintf", or, worse, "malloc, strcpy and multiple strcat". These are a buffer overflow waiting to happen (when changing part of those while doing ongoing maintenance; also the places where they use "+" is not checked for overflow). That said, if they do it, we can do it that way, to= o. * The environment variable GUIX_ALSA_PLUGIN_DIRS is only checked if the respective file does not exist in alsa-lib. That is not how environment variables usually work--it should be possible to override built-in things by setting this environment variable, too. * Instead of alloca and strcpy, can just use strdupa. * strtok_r man page states that the first argument should be NULL on the non-first calls. You do that already, but maybe add a comment why that is done where it's set to NULL. * strtok_r man page states that "On some implementations, *saveptr is requi= red to be NULL on the first call to strtok_r() that is being used to parse str= .". So I'd use "char* saveptr =3D NULL;" * Instead of malloc and sprintf, could just use asprintf. But they don't, so let's not either, for easier review. Also, magical value 32... sigh. Well, they do it, too. * If GUIX_ALSA_PLUGIN_DIRS contained for example "a:" then it would search "a" and "/", right? OK as long as we want that. Otherwise LGTM! --Sig_/Txz4xBtVh+deZhNGdMRPbn7 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl8gA3kACgkQ5xo1VCww uqX71wgAnuA4W4hCgGgf4voKKgP75dr7156T3uabZ2cqpwboRuMIsF/LzsWLOe/x vuow284NYaDdSvIbCcmji0bXy+FIfyqaSR/w161BUDCRsOIlwf+4yk2F3TsnxOxf 0mYZPDMaTjl4uTEyi/CcpGTIX667Zsy0gHtmALwbAByH3m3onf6F2VqSFvMXchlk CkLmyNV6yaOsSCXeNdT3pqkJKBDcLYTqqTxe9PHLp0/gjAyv18hzBnyb4aKNJr0J SrRRF3RZ05PwtH+51Yd/zIY9+iu0z8yx498bF5wNhrRiHsvs5mv6hTf46+EAXr6X KYZCAva+/iFV0UAMfv4Z27XuVl2LkQ== =PlR0 -----END PGP SIGNATURE----- --Sig_/Txz4xBtVh+deZhNGdMRPbn7--