From: Michael Schroeder Date: Sat, 25 Sep 2021 21:09:44 +0000 (+0200) Subject: Make repo line parsing not crash if the last argument is missing X-Git-Tag: 0.7.21~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d53fe7416fc546ade29aea50a51a43f4bfe0a94;p=thirdparty%2Flibsolv.git Make repo line parsing not crash if the last argument is missing Fixes issue #473. --- diff --git a/ext/testcase.c b/ext/testcase.c index 055452f8..e3b245c8 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -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 case */ if (!strcmp(pieces[4], ""))