All of lore.kernel.org
 help / color / mirror / Atom feed
From: khalasa@piap.pl (Krzysztof Hałasa)
To: alsa-devel@alsa-project.org
Subject: SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser
Date: Fri, 14 Jun 2013 13:59:38 +0200	[thread overview]
Message-ID: <m3obb8kimt.fsf@t19.piap.pl> (raw)

Hi,

Fixes a segfault when getgrnam_r() returns 0 and still sets pgrp to NULL
when the group simply doesn't exist.

--- alsa-lib/src/pcm/pcm_direct.c	2013-05-21 10:48:28.000000000 +0200
+++ alsa-lib/src/pcm/pcm_direct.c	2013-06-14 13:31:28.981013646 +0200
@@ -1636,7 +1636,7 @@
 				if (buffer == NULL)
 					return -ENOMEM;
 				int st = getgrnam_r(group, &grp, buffer, len, &pgrp);
-				if (st != 0) {
+				if (st != 0 || !pgrp) {
 					SNDERR("The field ipc_gid must be a valid group (create group %s)", group);
 					free(buffer);
 					return -EINVAL;

-- 
Krzysztof Halasa

Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

             reply	other threads:[~2013-06-14 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 11:59 Krzysztof Hałasa [this message]
2013-06-14 12:16 ` SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser Jaroslav Kysela

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

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

  git send-email \
    --in-reply-to=m3obb8kimt.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=alsa-devel@alsa-project.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.