]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix crash with %include
authorDaniel Pinto <danielpinto52@gmail.com>
Sun, 28 May 2017 08:53:14 +0000 (09:53 +0100)
committerDaniel Pinto <danielpinto52@gmail.com>
Sun, 28 May 2017 08:53:14 +0000 (09:53 +0100)
Fixes crash when including a folder that contains a non-empty file
without any values followed by any other non-empty file.

src/common/confline.c

index f04b7a8757ab381240a3c18d023a53f7dcc8df9b..c2122a1c68bb16950394e0f9f2d7d4de15b3840d 100644 (file)
@@ -300,7 +300,8 @@ config_process_include(const char *path, int recursion_level, int extended,
     tor_free(config_file);
 
     **next = included_list;
-    *next = &(*list_last)->next;
+    if (*list_last)
+      *next = &(*list_last)->next;
 
   } SMARTLIST_FOREACH_END(config_file);
   smartlist_free(config_files);