mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Don't memcpy to nullptr even if length is zero
This commit is contained in:
parent
4c1d2e9350
commit
9dd0d3f550
2 changed files with 9 additions and 5 deletions
|
|
@ -104,9 +104,11 @@ Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_h
|
|||
|
||||
CharString charstr = p_request_data.utf8();
|
||||
size_t len = charstr.length();
|
||||
raw_data.resize(len);
|
||||
uint8_t *w = raw_data.ptrw();
|
||||
memcpy(w, charstr.ptr(), len);
|
||||
if (len > 0) {
|
||||
raw_data.resize(len);
|
||||
uint8_t *w = raw_data.ptrw();
|
||||
memcpy(w, charstr.ptr(), len);
|
||||
}
|
||||
|
||||
return request_raw(p_url, p_custom_headers, p_ssl_validate_domain, p_method, raw_data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue