If the default write callback is used and no destination has been set, a
NULL pointer would be passed to fwrite()'s 4th argument.
OSS-fuzz bug https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3327
(not publicly open yet)
Detected by OSS-fuzz
Closes #1874
}
writeit = data->set.fwrite_rtp?data->set.fwrite_rtp:data->set.fwrite_func;
+
+ if(!data->set.fwrite_rtp && !data->set.is_fwrite_set &&
+ !data->set.rtp_out) {
+ /* if no callback is set for either RTP or default, the default function
+ fwrite() is utilized and that can't handle a NULL input */
+ failf(data, "No destination to default data callback!");
+ return CURLE_WRITE_ERROR;
+ }
+
wrote = writeit(ptr, 1, len, data->set.rtp_out);
if(CURL_WRITEFUNC_PAUSE == wrote) {