summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:54:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:54:07 +0900
commit8a7ffe4fc2b44b84fb045f80c1a016b3f200aa8b (patch)
treeb51f0d1b486157492f0fb273705ab9c486097833
parent40d5592805eaa650df84c50b9fed3cbdc4823fc5 (diff)
downloadlibsolv-8a7ffe4fc2b44b84fb045f80c1a016b3f200aa8b.tar.gz
libsolv-8a7ffe4fc2b44b84fb045f80c1a016b3f200aa8b.tar.bz2
libsolv-8a7ffe4fc2b44b84fb045f80c1a016b3f200aa8b.zip
Imported Upstream version 0.6.10upstream/0.6.10
Change-Id: Ia0aa60fc8934d4022da0cf8669ae3e4e121f3386 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r--VERSION.cmake2
-rw-r--r--package/libsolv.changes7
-rw-r--r--src/policy.c25
3 files changed, 16 insertions, 18 deletions
diff --git a/VERSION.cmake b/VERSION.cmake
index d1494ff..92a1b90 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -49,5 +49,5 @@ SET(LIBSOLVEXT_SOVERSION "0")
SET(LIBSOLV_MAJOR "0")
SET(LIBSOLV_MINOR "6")
-SET(LIBSOLV_PATCH "9")
+SET(LIBSOLV_PATCH "10")
diff --git a/package/libsolv.changes b/package/libsolv.changes
index 57dede3..ad435b9 100644
--- a/package/libsolv.changes
+++ b/package/libsolv.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Mar 18 11:04:34 CET 2015 - mls@suse.de
+
+- fix bug in dislike_old_versions that could lead to a segfault
+ [bnc#922352]
+- bump version to 0.6.10
+
+-------------------------------------------------------------------
Mon Mar 9 16:42:35 CET 2015 - mls@suse.de
- rework splitprovides handling [bnc#921332]
diff --git a/src/policy.c b/src/policy.c
index a0ecec1..93d7440 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -1048,16 +1048,15 @@ sort_by_common_dep(Pool *pool, Queue *plist)
static void
dislike_old_versions(Pool *pool, Queue *plist)
{
- int i, count = plist->count;
- Id *elements = plist->elements;
- int bad = 0;
+ int i, count;
- for (i = 0; i < count; i++)
+ for (i = 0, count = plist->count; i < count; i++)
{
- Id p = elements[i];
+ Id p = plist->elements[i];
Solvable *s = pool->solvables + p;
Repo *repo = s->repo;
Id q, qq;
+ int bad = 0;
if (!repo || repo == pool->installed)
continue;
@@ -1072,30 +1071,22 @@ dislike_old_versions(Pool *pool, Queue *plist)
{
if (repo->priority > qs->repo->priority)
continue;
- elements[i] = -p;
bad = 1;
break;
}
if (pool_evrcmp(pool, qs->evr, s->evr, EVRCMP_COMPARE) > 0)
{
- elements[i] = -p;
bad = 1;
break;
}
}
- }
- if (!bad)
- return;
- /* now move negative elements to the back */
- for (i = 0; i < count; i++)
- {
- Id p = elements[i];
- if (p >= 0)
+ if (!bad)
continue;
+ /* bring to back */
if (i < plist->count - 1)
{
- memmove(elements + i, elements + i + 1, (plist->count - 1 - i) * sizeof(Id));
- elements[plist->count - 1] = -p;
+ memmove(plist->elements + i, plist->elements + i + 1, (plist->count - 1 - i) * sizeof(Id));
+ plist->elements[plist->count - 1] = p;
}
i--;
count--;