Submitted By: Boris Buegling <boris@icculus.org>
Date: 2003-03-22
Initial Package Version: 0.2.32
Origin: None
Description: Both the SDL alsa-driver and esound use the environment variable
AUDIODEV, unfortunately for completely different purposes. If the AUDIODEV
variable is set and contains no slashes, esound will segfault. This patch
introduces a second check, which prevents this.

diff -Naur esound-0.2.32/util.c esound-0.2.32.foo/util.c
--- esound-0.2.32/util.c	2003-08-01 15:25:14.000000000 +0200
+++ esound-0.2.32.foo/util.c	2004-03-22 21:52:50.838188472 +0100
@@ -31,7 +31,10 @@
 			audiodev = "";
 		} else {
 			audiodev = strrchr(audiodev, '/');
-			audiodev++;
+			if (!audiodev)
+				audiodev = "";
+			else
+				audiodev++;
 		}
 		dirname = malloc(strlen(audiodev) + sizeof("/tmp/.esd"));
 		strcpy(dirname, "/tmp/.esd");
