]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Make repo line parsing not crash if the last argument is missing
authorMichael Schroeder <mls@suse.de>
Sat, 25 Sep 2021 21:09:44 +0000 (23:09 +0200)
committerMichael Schroeder <mls@suse.de>
Sat, 25 Sep 2021 21:09:44 +0000 (23:09 +0200)
Fixes issue #473.

ext/testcase.c

index 055452f8355afb99f86ac1c89a1b002af4d6b3fd..e3b245c88a2b2e501377f8cb576517e8e050577b 100644 (file)
@@ -2096,7 +2096,7 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
            }
           repo->priority = prio;
           repo->subpriority = subprio;
-         if (strcmp(pieces[3], "empty") != 0)
+         if (strcmp(pieces[3], "empty") != 0 && npieces > 4)
            {
              const char *repotype = pool_tmpjoin(pool, pieces[3], 0, 0);       /* gets overwritten in <inline> case */
              if (!strcmp(pieces[4], "<inline>"))