diff options
author | Job Snijders <job@cvs.openbsd.org> | 2021-10-27 18:09:09 +0000 |
---|---|---|
committer | Job Snijders <job@cvs.openbsd.org> | 2021-10-27 18:09:09 +0000 |
commit | 26a7734971c33e4dbf11ea7066d990e21a552241 (patch) | |
tree | cf8b2820b5c4d66f2c376cdf6bd73bb54fdd0b6e /usr.sbin | |
parent | 52246f34ed829ea7ac02990e25a9625720702c3c (diff) |
Limit length on URIs
OK beck@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/rpki-client/validate.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/rpki-client/validate.c b/usr.sbin/rpki-client/validate.c index f511edc1f6e..8380d8c0de0 100644 --- a/usr.sbin/rpki-client/validate.c +++ b/usr.sbin/rpki-client/validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: validate.c,v 1.17 2021/10/24 12:06:16 job Exp $ */ +/* $OpenBSD: validate.c,v 1.18 2021/10/27 18:09:08 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -321,6 +321,9 @@ valid_uri(const char *uri, size_t usz, const char *proto) { size_t s; + if (usz > 2048) + return 0; + for (s = 0; s < usz; s++) if (!isalnum((unsigned char)uri[s]) && !ispunct((unsigned char)uri[s])) |