From 5bf4b158a81b7fd5e0879ecdeca20410c9362cf0 Mon Sep 17 00:00:00 2001 From: DmitriyMusatkin Date: Fri, 31 Jan 2025 16:38:29 -0800 Subject: [PATCH] lets see if this gets flagged --- source/uri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/uri.c b/source/uri.c index 88a7f91ea..c59013b72 100644 --- a/source/uri.c +++ b/source/uri.c @@ -282,8 +282,8 @@ static void s_parse_scheme(struct uri_parser *parser, struct aws_byte_cursor *st return; } - /* Ensure location_of_colon is not the last character before checking *(location_of_colon + 1) */ - if ((size_t)(location_of_colon - str->ptr) + 1 >= str->len || *(location_of_colon + 1) != '/') { + /* make sure we didn't just pick up the port by mistake */ + if ((size_t)(location_of_colon - str->ptr) < str->len && *(location_of_colon + 1) != '/') { /* make sure we didn't just pick up the port by mistake */ parser->state = ON_AUTHORITY; return;