[alsa-devel] SEGFAULT in ALSA lib 1.0.27.1 pcm_direct parser
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
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.
participants (2)
-
Jaroslav Kysela -
khalasa@piap.pl