summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2019-10-07 15:35:28 +0200
committerAllan McRae <allan@archlinux.org>2019-10-09 07:39:35 +0200
commite8d4228614e4f45f74a5233eb7a322494429fd22 (patch)
treed5b8905ce609b9e95fb91f25b7448c720b48e542
parent379f7151056e804ba61caa6c72407ffa79c6649a (diff)
downloadpacman-e8d4228614e4f45f74a5233eb7a322494429fd22.tar.gz
pacman-e8d4228614e4f45f74a5233eb7a322494429fd22.tar.xz
signing: handle unknown uid in key import
With unknown uid pacman crashed. Return with error from email_from_uid() if uid is NULL. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/signing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index f9569ac5..30d057a3 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -478,6 +478,11 @@ static int email_from_uid(const char *uid, char **email)
{
char *start, *end;
+ if (uid == NULL) {
+ email = NULL;
+ return -1;
+ }
+
start = strrchr(uid, '<');
if(start) {
end = strrchr(start, '>');