mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-15 00:44:06 +00:00
Log entire line when curldbg lacks a newline (#2526)
Previously -o curldbg=body would read uninitialized memory.
This commit is contained in:
parent
6faaff10ee
commit
5691071ac6
@ -1920,6 +1920,10 @@ int S3fsCurl::RawCurlDebugFunc(const CURL* hcurl, curl_infotype type, char* data
|
|||||||
int newline = 0;
|
int newline = 0;
|
||||||
if (eol == nullptr) {
|
if (eol == nullptr) {
|
||||||
eol = reinterpret_cast<char*>(memchr(p, '\r', remaining));
|
eol = reinterpret_cast<char*>(memchr(p, '\r', remaining));
|
||||||
|
if (eol == nullptr) {
|
||||||
|
// No newlines, just emit entire line.
|
||||||
|
eol = p + remaining;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (eol > p && *(eol - 1) == '\r') {
|
if (eol > p && *(eol - 1) == '\r') {
|
||||||
newline++;
|
newline++;
|
||||||
|
Loading…
Reference in New Issue
Block a user