Ticket #27 (closed defect: fixed)

Opened 2 years ago

Last modified 10 months ago

padsp's access wrapper doesn't check for NULL, breaks "padsp firefox"

Reported by: alon Assigned to: lennart
Priority: normal Milestone:
Component: clients Severity: normal
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 &&

Attachments

padsp_access_fix.udiff (0.7 kB) - added by alon on 08/30/06 17:37:35.
the patch

Change History

08/30/06 17:37:35 changed by alon

  • attachment padsp_access_fix.udiff added.

the patch

08/30/06 17:38:55 changed by alon

  • summary changed from padsp has access wrapper doesn't check for NULL, breaks "padsp firefox" on ubuntu to padsp's access wrapper doesn't check for NULL, breaks "padsp firefox".

Added the diff as an attachment since trac killed the indentation when the diff was put in the comment.

08/30/06 18:00:55 changed by alon

  • severity changed from major to normal.

I just checked with the latest svn sources, seems it isn't fixed there yet too, so I think this applies not only to 0.9.5 but to the latest as well.

08/31/06 17:31:34 changed by lennart

  • status changed from new to closed.
  • resolution set to fixed.

(In [1352]) work around bug in firefox which apparently misuses access() as NULL pointer test. Original patch by "alon". (Closes #27)

01/25/08 00:05:47 changed by coling

See #227 (200 bugs in the future ;)) for a possibly more generic fix for this issue.