From b2b3e71456754725d16ee9006c60d9a0f8cfa209 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 28 Jan 2025 12:23:15 -0500 Subject: [PATCH] KPath: Remove memset after allocate. We don't really need to clear these buffers, as they're basically always used with user_strlcpy or precisely sized buffers, so there should be no risk of "leaking" information to userland. --- src/system/kernel/fs/KPath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/fs/KPath.cpp b/src/system/kernel/fs/KPath.cpp index 32ded8b69d..4ad2492868 100644 --- a/src/system/kernel/fs/KPath.cpp +++ b/src/system/kernel/fs/KPath.cpp @@ -440,7 +440,7 @@ KPath::_AllocateBuffer() return B_NO_MEMORY; } - memset(fBuffer, 0, fBufferSize); + fBuffer[0] = '\0'; fFailed = false; return B_OK; }