From 8f92fe47a7c4d999271bc28ffbbeeea50d686813 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Wed, 25 Feb 2015 01:10:35 +1000 Subject: calculate_removed_size: ensure llstat succeeds Signed-off-by: Allan McRae --- lib/libalpm/diskspace.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 3b496c2e..aaa00365 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -235,7 +235,12 @@ static int calculate_removed_size(alpm_handle_t *handle, const char *filename = file->name; snprintf(path, PATH_MAX, "%s%s", handle->root, filename); - llstat(path, &st); + + if(llstat(path, &st) == -1) { + _alpm_log(handle, ALPM_LOG_WARNING, + _("could not get file information for %s\n"), filename); + continue; + } /* skip directories and symlinks to be consistent with libarchive that * reports them to be zero size */ -- cgit v1.2.3-70-g09d2