From: Michael Schroeder Date: Tue, 29 Jul 2025 08:02:04 +0000 (+0200) Subject: Fix potential access of freed mem in the genid testcase X-Git-Tag: 0.7.35~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fddfaf4652d31b0f7d6d8f2c763b6fa8cea88b0;p=thirdparty%2Flibsolv.git Fix potential access of freed mem in the genid testcase --- diff --git a/ext/testcase.c b/ext/testcase.c index 3be2a11b..f93861ce 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -1634,8 +1634,9 @@ testcase_solverresult(Solver *solv, int resultflags) continue; id = solv->job.elements[i + 1]; s = testcase_dep2str(pool, id); - strqueue_push(&sq, pool_tmpjoin(pool, "genid dep ", s, 0)); - if ((id2 = testcase_str2dep(pool, s)) != id) + s = pool_tmpjoin(pool, "genid dep ", s, 0); + strqueue_push(&sq, s); + if ((id2 = testcase_str2dep(pool, s + 10)) != id) { s = pool_tmpjoin(pool, "genid roundtrip error: ", testcase_dep2str(pool, id2), 0); strqueue_push(&sq, s);