]> 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>
Fri, 4 Mar 2022 10:47:38 +0000 (11:47 +0100)
Fixes issue #473.

ext/testcase.c

index 458d19b710d34552bae9e16d88c403c6226ad061..902ce3d6c6d0b04d509b0db800ea610e262f2ac5 100644 (file)
@@ -2656,7 +2656,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>"))