[pacman-dev] [PATCH 2/2] signing: handle unknown uid in key import
Christian Hesse
list at eworm.de
Mon Oct 7 13:35:28 UTC 2019
From: Christian Hesse <mail at eworm.de>
With unknown uid pacman crashed. Return with error from email_from_uid()
if uid is NULL.
Signed-off-by: Christian Hesse <mail at eworm.de>
---
lib/libalpm/signing.c | 5 +++++
1 file changed, 5 insertions(+)
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, '>');
More information about the pacman-dev
mailing list