Avoid reading uninitialized memory when checking SANE_CONFIG_DIR

DEVEL_2_0_BRANCH-1
Henning Geinitz 2001-04-29 19:07:34 +00:00
rodzic 9e40af43a2
commit a1cacda510
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -96,7 +96,7 @@ sanei_config_open (const char *filename)
if (dir_list)
{
len = strlen (dir_list);
if (dir_list[len - 1] == DIR_SEP[0])
if ((len > 0) && (dir_list[len - 1] == DIR_SEP[0]))
{
/* append default search directories: */
mem = malloc (len + sizeof (DEFAULT_DIRS));