From e8d4228614e4f45f74a5233eb7a322494429fd22 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 7 Oct 2019 15:35:28 +0200 Subject: 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 Signed-off-by: Allan McRae --- lib/libalpm/signing.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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, '>'); -- cgit v1.2.3-24-g4f1b