Skip to content
Snippets Groups Projects
Commit 28dd9502 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud
Browse files

winsyslog: prevent buffer overrun on when copying formatted strings

The Windows vsyslog emulation is somewhat archaic and assumes that
the log line while max out at 1024 characters, which is not the
case nowadays. Using vsnprintf instead vsprintf, will truncate the
copy instead of writing outside the buffer.

Change-Id: I6a6176fd79eeaf663d2cb9396715babe5254a6e2
parent 63de2284
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ void closelog(void) ...@@ -83,7 +83,7 @@ void closelog(void)
CONST CHAR *arr[1]; CONST CHAR *arr[1];
char tmp[1024]; char tmp[1024];
vsprintf(tmp, format, arglist); vsnprintf(tmp, 1024, format, arglist);
#ifndef RING_UWP #ifndef RING_UWP
arr[0] = tmp; arr[0] = tmp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment