1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-01-08 14:36:22 +01:00

Fix varargs leaks

This commit is contained in:
Veli-Matti Visuri 2017-12-04 21:20:05 +02:00
parent dd694061b4
commit 78b2b58ab1
3 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,7 @@ static _inline void real_dprintf(char *format, ...)
vsnprintf_s(buffer + len, sizeof(buffer)-len, sizeof(buffer)-len - 3, format, args); vsnprintf_s(buffer + len, sizeof(buffer)-len, sizeof(buffer)-len - 3, format, args);
strcat_s(buffer, sizeof(buffer), "\r\n"); strcat_s(buffer, sizeof(buffer), "\r\n");
OutputDebugStringA(buffer); OutputDebugStringA(buffer);
va_end(args);
} }
#endif #endif

View File

@ -21,6 +21,7 @@ static _inline void real_dprintf(char *format, ...) {
vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer)-3, format,args); vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer)-3, format,args);
strcat_s(buffer, sizeof(buffer), "\r\n"); strcat_s(buffer, sizeof(buffer), "\r\n");
OutputDebugString(buffer); OutputDebugString(buffer);
va_end(args);
} }
// Simple macro to close a handle and set the handle to NULL. // Simple macro to close a handle and set the handle to NULL.

View File

@ -21,6 +21,7 @@ static _inline void real_dprintf(char *format, ...) {
vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer)-3, format,args); vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer)-3, format,args);
strcat_s(buffer, sizeof(buffer), "\r\n"); strcat_s(buffer, sizeof(buffer), "\r\n");
OutputDebugStringA(buffer); OutputDebugStringA(buffer);
va_end(args);
} }
// Simple macro to close a handle and set the handle to NULL. // Simple macro to close a handle and set the handle to NULL.