libsolv/Fix-segfault-on-conflict-resolution-when-using-bindi.patch

31 lines
981 B
Diff
Raw Normal View History

2022-10-11 18:54:18 +08:00
From 2b5e6c28be7dffe1a3b5e90a35c5ee425c08aeb0 Mon Sep 17 00:00:00 2001
From: niner <nine@detonation.org>
Date: Tue, 8 Feb 2022 18:10:54 +0100
Subject: [PATCH] Fix segfault on conflict resolution when using bindings
Solutionelement objects were created with a wrong solutionid (i.e. the
solution element id was used for the solutionid field). This led to invalid
array indexes when trying to read the extraflags which then escalated
into a segfault. Fix by setting solutionid correctly in the Solutionelement
constructor.
---
bindings/solv.i | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/solv.i b/bindings/solv.i
index 3a6bac46..1d35bf61 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -3411,7 +3411,7 @@ returnself(matchsolvable)
e = solv_calloc(1, sizeof(*e));
e->solv = solv;
e->problemid = problemid;
- e->solutionid = id;
+ e->solutionid = solutionid;
e->id = id;
e->type = type;
e->p = p;
--
2.27.0