[Kernel] Change _vsnprintf overflow behavior.
This commit is contained in:
committed by
Radosław Gliński
parent
016797d19c
commit
dfa70b3677
@@ -1025,8 +1025,9 @@ SHIM_CALL _vsnprintf_entry(PPCContext* ppc_context) {
|
|||||||
buffer[count] = '\0';
|
buffer[count] = '\0';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Overflowed buffer. We still return the count we would have written.
|
// Overflowed buffer.
|
||||||
std::memcpy(buffer, data.str().c_str(), buffer_count);
|
std::memcpy(buffer, data.str().c_str(), buffer_count);
|
||||||
|
count = -1;
|
||||||
}
|
}
|
||||||
SHIM_SET_RETURN_32(count);
|
SHIM_SET_RETURN_32(count);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user