diff options
author | marcus <marcus@FreeBSD.org> | 2007-03-23 07:51:46 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2007-03-23 07:51:46 +0800 |
commit | e883e9e5c1e0dc5a9404f378f6ce8d5bcdc4af7d (patch) | |
tree | a72954df2a9f3ce9741257a9fabba331b137c345 /audio/esound | |
parent | dbd192f61c2d0494630344619564a40ac0598bd1 (diff) | |
download | freebsd-ports-gnome-e883e9e5c1e0dc5a9404f378f6ce8d5bcdc4af7d.tar.gz freebsd-ports-gnome-e883e9e5c1e0dc5a9404f378f6ce8d5bcdc4af7d.tar.zst freebsd-ports-gnome-e883e9e5c1e0dc5a9404f378f6ce8d5bcdc4af7d.zip |
Protect the check for the mode argument to open with a test to make
sure flags contains O_CREAT. This fixes a potential bus error.
PR: 110673
Diffstat (limited to 'audio/esound')
-rw-r--r-- | audio/esound/Makefile | 2 | ||||
-rw-r--r-- | audio/esound/files/patch-esddsp.c | 38 |
2 files changed, 36 insertions, 4 deletions
diff --git a/audio/esound/Makefile b/audio/esound/Makefile index 6717a68c595e..7e21222d63fb 100644 --- a/audio/esound/Makefile +++ b/audio/esound/Makefile @@ -7,7 +7,7 @@ PORTNAME= esound PORTVERSION= 0.2.37 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= audio MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME}/0.2 diff --git a/audio/esound/files/patch-esddsp.c b/audio/esound/files/patch-esddsp.c index c1175da944ab..6751ca4abbb9 100644 --- a/audio/esound/files/patch-esddsp.c +++ b/audio/esound/files/patch-esddsp.c @@ -1,6 +1,6 @@ ---- esddsp.c.orig Tue Apr 26 22:41:23 2005 -+++ esddsp.c Tue Apr 26 22:42:04 2005 -@@ -223,9 +223,12 @@ open (const char *pathname, int flags, . +--- esddsp.c.orig Mon Jan 1 18:56:06 2007 ++++ esddsp.c Thu Mar 22 19:49:15 2007 +@@ -224,9 +224,12 @@ open_wrapper (int (*func) (const char *, dsp_init (); @@ -16,3 +16,35 @@ if (!strcmp (pathname, "/dev/dsp")) { +@@ -272,9 +275,12 @@ open (const char *pathname, int flags, . + } + } + +- va_start (args, flags); +- mode = va_arg (args, mode_t); +- va_end (args); ++ if ((flags & O_CREAT) != 0) ++ { ++ va_start (args, flags); ++ mode = va_arg (args, mode_t); ++ va_end (args); ++ } + + return open_wrapper(func, pathname, flags, mode); + } +@@ -299,9 +305,12 @@ open64 (const char *pathname, int flags, + } + } + +- va_start (args, flags); +- mode = va_arg (args, mode_t); +- va_end (args); ++ if ((flags & O_CREAT) != 0) ++ { ++ va_start (args, flags); ++ mode = va_arg (args, mode_t); ++ va_end (args); ++ } + + return open_wrapper(func, pathname, flags, mode); + } |