This patch will fix the following libmikmod 3.1.9 problems: - listing all the drivers, or selecting a missing driver, can cause a coredump. To apply the patch, enter your mikmod source directory and run patch -p1 < path/to/patch-libmikmod-3.1.9-a (adjust the path to the patch file, of course). diff -uNr libmikmod-3.1.9/playercode/mdriver.c libmikmod-3.1.10/playercode/mdriver.c --- libmikmod-3.1.9/playercode/mdriver.c Mon Feb 14 22:10:22 2000 +++ libmikmod-3.1.10/playercode/mdriver.c Tue Oct 17 00:18:06 2000 @@ -20,7 +20,7 @@ /*============================================================================== - $Id: mdriver.c,v 1.33 2000/02/14 22:10:22 miod Exp $ + $Id: mdriver.c,v 1.35 2000/10/17 00:18:06 miod Exp $ These routines are used to access the available soundcard drivers. @@ -175,14 +175,18 @@ MUTEX_LOCK(lists); /* compute size of buffer */ - for(l=firstdriver;l;l=l->next) len+=4+(l->next?1:0)+strlen(l->Version); + for(l=firstdriver;l;l=l->next) + if(l->Version) + len+=4+(l->next?1:0)+strlen(l->Version); if(len) if((list=_mm_malloc(len*sizeof(CHAR)))) { list[0]=0; /* list all registered device drivers : */ for(t=1,l=firstdriver;l;l=l->next,t++) - sprintf(list,(l->next)?"%s%2d %s\n":"%s%2d %s",list,t,l->Version); + if(l->Version) + sprintf(list,(l->next)?"%s%2d %s\n":"%s%2d %s", + list,t,l->Version); } MUTEX_UNLOCK(lists); return list; @@ -219,8 +223,11 @@ MUTEX_LOCK(lists); cruise=firstdriver; while(cruise) { - if (!(strcasecmp(alias,cruise->Alias))) break; - cruise=cruise->next;rank++; + if (cruise->Alias) { + if (!(strcasecmp(alias,cruise->Alias))) break; + rank++; + } + cruise=cruise->next; } if(!cruise) rank=0; MUTEX_UNLOCK(lists); @@ -469,7 +476,8 @@ cmdline=NULL; for(t=1,md_driver=firstdriver;md_driver;md_driver=md_driver->next,t++) - if(md_driver->IsPresent()) break; + if(md_driver->Version) + if(md_driver->IsPresent()) break; if(!md_driver) { _mm_errno = MMERR_DETECTING_DEVICE; @@ -481,7 +489,9 @@ md_device = t; } else { /* if n>0, use that driver */ - for(t=1,md_driver=firstdriver;(md_driver)&&(t!=md_device);md_driver=md_driver->next,t++); + for(t=1,md_driver=firstdriver;(md_driver)&&(t!=md_device);md_driver=md_driver->next) + if(md_driver->Version) + t++; if(!md_driver) { _mm_errno = MMERR_INVALID_DEVICE;