Ticket #27 (closed defect: fixed)
padsp's access wrapper doesn't check for NULL, breaks "padsp firefox"
| Reported by: | alon | Owned by: | lennart |
|---|---|---|---|
| Milestone: | Component: | clients | |
| Keywords: | padsp access | Cc: |
Description
Hi,
Short summary: trying "padsp firefox" failed, gdb discovered that the failure was in access. I'll spare you the stacktrace - the crux of it is that pathname was ==NULL, and padsp failed in the call to strcmp.
Solution: this is the unified diff patch I used to fix it. After applying it I successfully used "padsp firefox" to play some music (using the mplayer embeddable plugin for firefox).
--- pulseaudio-0.9.5/src/utils/padsp.c 2006-08-19 00:29:26.000000000 +0300 +++ pulseaudio-0.9.5-alon/src/utils/padsp.c 2006-08-29 01:36:30.010620500 +0300 @@ -2122,7 +2122,12 @@
int access(const char *pathname, int mode) {
debug(DEBUG_LEVEL_VERBOSE, FILE": access(%s)\n", pathname);
- + if (pathname == NULL) { + // according to the man page from ubuntu the closest error condition: + // EFAULT pathname points outside your accessible address space + errno = EFAULT; + return -1; + }
if (strcmp(pathname, "/dev/dsp") != 0 &&
strcmp(pathname, "/dev/adsp") != 0 && strcmp(pathname, "/dev/sndstat") != 0 &&
