Commit 7da6ef50 authored by Andreas Joachim Peters's avatar Andreas Joachim Peters Committed by Elvin Sindrilaru

FUSE: fix possible SEGV in sscanf(stat) - fixes EOS-2081

parent 5c5cab08
Pipeline #413338 failed with stages
in 8 minutes and 52 seconds
......@@ -1682,7 +1682,7 @@ filesystem::stat(const char* path, struct stat* buf, uid_t uid, gid_t gid,
char tag[1024];
tag[0] = 0;
// Parse output
int items = sscanf(response->GetBuffer(),
int items = sscanf(response->ToString().c_str(),
"%1023s %llu %llu %llu %llu %llu %llu %llu %llu "
"%llu %llu %llu %llu %llu %llu %llu %llu",
tag, (unsigned long long*) &sval[0],
......@@ -1704,7 +1704,7 @@ filesystem::stat(const char* path, struct stat* buf, uid_t uid, gid_t gid,
if ((items != 17) || (strcmp(tag, "stat:"))) {
int retc = 0;
items = sscanf(response->GetBuffer(), "%1023s retc=%i", tag, &retc);
items = sscanf(response->ToString().c_str(), "%1023s retc=%i", tag, &retc);
if ((!strcmp(tag, "stat:")) && (items == 2)) {
errno = retc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment