From 9d6736c9a2232ed105ebe38b3a2e21a98f5dd5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= Date: Fri, 14 Jun 2013 13:59:38 +0200 Subject: pcm_direct: fix SEGFAULT when getgrnam_r() returns 0 and pgrp is NULL Signed-off-by: Krzysztof Halasa Signed-off-by: Jaroslav Kysela --- src/pcm/pcm_direct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index 101d3c8a..899c2504 100644 --- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -1650,7 +1650,7 @@ int snd_pcm_direct_parse_open_conf(snd_config_t *root, snd_config_t *conf, 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; -- cgit v1.2.1