rtsp: use explicit postfieldsize if specified

Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Closes #19345
This commit is contained in:
Joshua Rogers 2025-11-04 00:15:22 +08:00 committed by Daniel Stenberg
parent 63e9721b63
commit feab390124
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -298,7 +298,8 @@ static CURLcode rtsp_setup_body(struct Curl_easy *data,
}
else {
if(data->set.postfields) {
size_t plen = strlen(data->set.postfields);
size_t plen = (data->set.postfieldsize >= 0) ?
(size_t)data->set.postfieldsize : strlen(data->set.postfields);
req_clen = (curl_off_t)plen;
result = Curl_creader_set_buf(data, data->set.postfields, plen);
}