parser-helper: Ensure file_next() does not remove the sentinel item
authorTobias Brunner <tobias@strongswan.org>
Mon, 30 Jun 2014 13:23:22 +0000 (15:23 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 1 Jul 2014 15:58:36 +0000 (17:58 +0200)
src/libstrongswan/utils/parser_helper.c

index 17307e9..4c6aa25 100644 (file)
@@ -96,7 +96,7 @@ METHOD(parser_helper_t, file_next, FILE*,
        char *name;
 
        array_get(this->files, ARRAY_TAIL, &file);
        char *name;
 
        array_get(this->files, ARRAY_TAIL, &file);
-       if (!file->matches)
+       if (!file->matches && file->name)
        {
                array_remove(this->files, ARRAY_TAIL, NULL);
                parser_helper_file_destroy(file);
        {
                array_remove(this->files, ARRAY_TAIL, NULL);
                parser_helper_file_destroy(file);