Skip to content

Commit 052dae3

Browse files
catenacyberbagder
authored andcommitted
ossfuzz: Prevent large numbers of headers from causing timeouts
As in commit e13aa01 Found by quadfuzz
1 parent 58d358f commit 052dae3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

curl_fuzzer_tlv.cc

+6
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ int fuzz_parse_tlv(FUZZ_DATA *fuzz, TLV *tlv)
157157
break;
158158

159159
case TLV_TYPE_MAIL_RECIPIENT:
160+
/* Limit the number of headers that can be added to a message to prevent
161+
timeouts. */
162+
if(fuzz->header_list_count >= TLV_MAX_NUM_CURLOPT_HEADER) {
163+
rc = 255;
164+
goto EXIT_LABEL;
165+
}
160166
tmp = fuzz_tlv_to_string(tlv);
161167
if (tmp == NULL) {
162168
// keep on despite allocation failure

0 commit comments

Comments
 (0)