diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index ec49c2a..2d27c42 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -367,7 +367,12 @@ static int extract_single_file(struct archive *archive, } else { /* do a stat as well, so we can see what symlinks point to */ struct stat sbuf; - stat(filename, &sbuf); + if(stat(filename, &sbuf) != 0) { + _alpm_log(PM_LOG_ERROR, _("extract: symlink %s points to %s which seems invalid\n"), + entryname, filename); + archive_read_data_skip(archive); + return(1); + } if(S_ISDIR(lsbuf.st_mode) && S_ISDIR(entrymode)) { /* case 12: existing dir, ignore it */