unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 40832@debbugs.gnu.org
Subject: bug#40832: alsa-lib cannot find its plugins
Date: Tue, 28 Jul 2020 12:52:41 +0200	[thread overview]
Message-ID: <20200728125241.4ff41418@scratchpost.org> (raw)
In-Reply-To: <20200424213727.GA11710@jasmine.lan>

[-- Attachment #1: Type: text/plain, Size: 1450 bytes --]

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, too.
* 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 required
to be NULL on  the first call to strtok_r() that is being used to parse str.".
So I'd use "char* saveptr = 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!

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-07-28 10:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 21:37 bug#40832: Audacity does not work with PulseAudio Leo Famulari
2020-04-24 23:15 ` Leo Famulari
2020-04-25  4:03   ` Leo Famulari
2020-04-26 20:03     ` bug#40832: alsa-lib cannot find its plugins Leo Famulari
2020-04-28 21:25   ` bug#40832: Audacity does not work with PulseAudio Ludovic Courtès
2020-04-28 22:39     ` Leo Famulari
2020-05-08 22:45       ` Leo Famulari
2020-05-09  5:24         ` Leo Famulari
2020-05-16 19:33 ` bug#40832: [PATCH 0/2] Help alsa-lib find its plugins Leo Famulari
2020-05-16 19:34   ` bug#40832: [PATCH 1/2] gnu: alsa-plugins: Add GUIX_ALSA_PLUGIN_DIRS search path specification Leo Famulari
2020-05-16 19:34   ` bug#40832: [PATCH 2/2] gnu: Help alsa-lib find its plugins on foreign distros Leo Famulari
2020-05-17 18:19   ` bug#40832: [PATCH 0/2] Help alsa-lib find its plugins Leo Famulari
2020-07-28 10:52 ` Danny Milosavljevic [this message]
2020-07-28 10:56   ` bug#40832: alsa-lib cannot " Danny Milosavljevic
2020-07-28 23:56     ` Leo Famulari
2020-07-28 23:56   ` Leo Famulari
2020-07-29 11:18     ` Danny Milosavljevic
2020-10-13 16:02   ` Leo Famulari
2021-02-01 20:51     ` Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728125241.4ff41418@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=40832@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).