summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/rpki-client/validate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/rpki-client/validate.c b/usr.sbin/rpki-client/validate.c
index f1a63f6c91b..71d08236084 100644
--- a/usr.sbin/rpki-client/validate.c
+++ b/usr.sbin/rpki-client/validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: validate.c,v 1.45 2022/09/03 14:41:47 job Exp $ */
+/* $OpenBSD: validate.c,v 1.46 2022/11/02 11:28:36 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -290,6 +290,8 @@ valid_uri(const char *uri, size_t usz, const char *proto)
if (proto != NULL) {
s = strlen(proto);
+ if (s >= usz)
+ return 0;
if (strncasecmp(uri, proto, s) != 0)
return 0;
}