summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2019-11-06 07:04:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2019-11-06 07:04:04 +0000
commitce56f95d5a84d1f5d42ab4cbf5af5c419d77b235 (patch)
tree3d411eb476f4b87a14c107f6c65eac5cf27b7f6b /usr.sbin
parent8ecae6eb53e54ed9e6bf92e778d9a600ad6d490d (diff)
If tal_parse_buffer() fails return early because the code that follows
will try to access the NULL tal pointer. Reported by Alexandre Hamada
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpki-client/tal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/rpki-client/tal.c b/usr.sbin/rpki-client/tal.c
index a383e58d6fc..3e434f5e990 100644
--- a/usr.sbin/rpki-client/tal.c
+++ b/usr.sbin/rpki-client/tal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tal.c,v 1.10 2019/11/04 09:39:06 claudio Exp $ */
+/* $OpenBSD: tal.c,v 1.11 2019/11/06 07:04:03 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -141,6 +141,8 @@ tal_parse(const char *fn, char *buf)
size_t dlen;
p = tal_parse_buffer(fn, buf);
+ if (p == NULL)
+ return NULL;
/* extract the TAL basename (without .tal suffix) */
d = basename(fn);