mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
pcm_direct: fix SEGFAULT when getgrnam_r() returns 0 and pgrp is NULL
Signed-off-by: Krzysztof Halasa <khalasa@piap.pl> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c91785e002
commit
9d6736c9a2
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue