read_dirs: always initialize l->next to NULL

Resolve a segfault when using multiple lower layers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-08-01 13:23:02 +02:00
parent 1ed274ba57
commit 21cb0e199d
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

6
main.c
View File

@ -998,11 +998,9 @@ read_dirs (char *path, bool low, struct ovl_layer *layers)
l->low = low;
if (low)
{
l->next = NULL;
if (last == NULL)
{
last = layers = l;
l->next = NULL;
}
last = layers = l;
else
{
last->next = l;