From a05df915505ab3e77e46e39a5b232086c43fc8bf Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 8 Jan 2008 06:27:36 +0000 Subject: [PATCH] windows-printf-format-string-protection-20080108 LICENSE MIT Do not pass strings generated from incoming network data to ??printf as the format string. Instead use a format string of "%s". This protects against %? expansions being inserted in the string. --- src/WINNT/afsd/smb3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index ff3f03b..fbb0cc3 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -168,7 +168,7 @@ void OutputDebugHexDump(unsigned char * buffer, int len) { for (i=0;i32 && k<127)?k:'.'; } if(i) { - osi_Log0(smb_logp, osi_LogSaveString(smb_logp, buf)); + osi_Log0(smb_logp, "%s", osi_LogSaveString(smb_logp, buf)); strcat(buf,"\r\n"); OutputDebugString(buf); } -- 1.9.4