Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-05-16 11:50:13 -0500
committerDan McGee <dan@archlinux.org>2011-05-16 11:50:13 -0500
commitaec60e37822509a1ca7fc53244878d3f1505d964 (patch)
treeff346bb35e239e2a957c0b9ce27ded2a14f34c60 /lib/libalpm/remove.c
parent93f02f5793ad7907aa0bc7c4a9fe64f0c7ce86f6 (diff)
Fix segfault when uninstalling broken backed-up symlink
Issue FS#24230. If a symlink is broken and included in the removal process of a package, we blew up and segfaulted due to alpm_compute_md5sum() returning NULL and then performing a strcmp() operation. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 7c8a99fb..22ae2bb8 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -266,7 +266,7 @@ static void unlink_file(pmpkg_t *info, char *filename, alpm_list_t *skip_remove,
FREE(pkghash);
} else {
char *filehash = alpm_compute_md5sum(file);
- int cmp = strcmp(filehash,pkghash);
+ int cmp = filehash ? strcmp(filehash, pkghash) : 0;
FREE(filehash);
FREE(pkghash);
if(cmp != 0) {