Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion htp/htp_request_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,17 @@ htp_status_t htp_parse_request_line_generic_ex(htp_connp_t *connp, int nul_termi
// special case: even though RFC's allow only SP (0x20), many
// implementations allow other delimiters, like tab or other
// characters that isspace() accepts.
while ((pos < len) && (!htp_is_space(data[pos]))) pos++;
pos = len - 1;
while ((pos > start) && (!htp_is_space(data[pos]))) pos--;
} else {
// reset bad_delim found in protocol part
bad_delim = 0;
for (size_t i = start; i < pos; i++) {
if (data[i] != 0x20 && htp_is_space(data[i])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume 0x20 is covered by htp_is_space. Are you adding it explicitly to avoid the func call?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm no I guess I'm failing to understand the logic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the goal is to set a warning if there are "spaces" in the URI other than 0x20, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the goal is to set a warning if there are "spaces" in the URI other than 0x20, right?

It looks so

I assume 0x20 is covered by htp_is_space.

Indeed, we want htp_is_space except for 0x20

bad_delim = 1;
break;
}
}
}
if (bad_delim) {
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
Expand Down