All of lore.kernel.org
 help / color / mirror / Atom feed
* SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser
@ 2013-06-14 11:59 Krzysztof Hałasa
  2013-06-14 12:16 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Hałasa @ 2013-06-14 11:59 UTC (permalink / raw)
  To: alsa-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser
  2013-06-14 11:59 SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser Krzysztof Hałasa
@ 2013-06-14 12:16 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2013-06-14 12:16 UTC (permalink / raw)
  To: Krzysztof Hałasa; +Cc: alsa-devel

Date 14.6.2013 13:59, Krzysztof Hałasa wrote:
> Hi,
> 
> Fixes a segfault when getgrnam_r() returns 0 and still sets pgrp to NULL
> when the group simply doesn't exist.

Thanks. Applied to our repo.

				Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-14 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14 11:59 SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser Krzysztof Hałasa
2013-06-14 12:16 ` Jaroslav Kysela

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.