Commit 7c0f7d51 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan

mapid.c (load_drivers): Fix segfault with missing conf data.

                        Forward port of r1478 on mapi_uninett branch.


git-svn-id: file:///home/svn/mapi/trunk@1479 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent d7f959e0
...@@ -2645,7 +2645,8 @@ load_drivers () ...@@ -2645,7 +2645,8 @@ load_drivers ()
if(devgroupstr != NULL) devgroup = atoi(devgroupstr); else devgroup = 0; if(devgroupstr != NULL) devgroup = atoi(devgroupstr); else devgroup = 0;
if (strlen (device) > 0 && strlen (driver) > 0) if (device && strlen(device) > 0 &&
driver && strlen(driver) > 0)
{ {
if (devgroup == onlydevgroup) { if (devgroup == onlydevgroup) {
if ((handle = load_driver (drvpath, driver)) != NULL) if ((handle = load_driver (drvpath, driver)) != NULL)
...@@ -2801,11 +2802,13 @@ load_drivers () ...@@ -2801,11 +2802,13 @@ load_drivers ()
} }
//Quick fix for a bug in the config file parser //Quick fix for a bug in the config file parser
if(format!=NULL) if (format!=NULL)
{ {
device[0] = '\0'; if (device!=NULL)
driver[0] = '\0'; device[0] = '\0';
if(description!=NULL) if (driver!=NULL)
driver[0] = '\0';
if (description!=NULL)
description[0] = '\0'; description[0] = '\0';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment