Skip to content

Commit

Permalink
apply the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Jan 27, 2025
1 parent 22c8968 commit 723cac4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ static void s_parse_scheme(struct uri_parser *parser, struct aws_byte_cursor *st
return;
}

/* 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) != '/') {
/* 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 */
parser->state = ON_AUTHORITY;
return;
}
Expand Down

0 comments on commit 723cac4

Please sign in to comment.