Ticket #27 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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 &&

Attachments

padsp_access_fix.udiff (0.7 kB) - added by alon 4 years ago.
the patch

Change History

Changed 4 years ago by alon

the patch

Changed 4 years ago 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.

Changed 4 years ago 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.

Changed 4 years ago 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)

Changed 3 years ago by coling

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

Note: See TracTickets for help on using tickets.