Skip to content

Commit

Permalink
ossfuzz: Prevent large numbers of headers from causing timeouts
Browse files Browse the repository at this point in the history
As in commit e13aa01

Found by quadfuzz
  • Loading branch information
catenacyber authored and bagder committed Jun 8, 2023
1 parent 58d358f commit 052dae3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions curl_fuzzer_tlv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ int fuzz_parse_tlv(FUZZ_DATA *fuzz, TLV *tlv)
break;

case TLV_TYPE_MAIL_RECIPIENT:
/* Limit the number of headers that can be added to a message to prevent
timeouts. */
if(fuzz->header_list_count >= TLV_MAX_NUM_CURLOPT_HEADER) {
rc = 255;
goto EXIT_LABEL;
}
tmp = fuzz_tlv_to_string(tlv);
if (tmp == NULL) {
// keep on despite allocation failure
Expand Down

0 comments on commit 052dae3

Please sign in to comment.