]> OCCT Git - occt-copy.git/commitdiff
0023278: Buffer underflow using memset in osd_host.cxx
authorPawel <pawel-kowalski@wp.pl>
Fri, 13 Jul 2012 14:00:52 +0000 (16:00 +0200)
committerPawel Kowalski <pawel-kowalski@wp.pl>
Fri, 20 Jul 2012 12:32:09 +0000 (16:32 +0400)
Zero memory uses the size of the array.

src/OSD/OSD_Host.cxx

index e9d8e122188da4c248fece1ae65dce6217a54e8e..5fb092552eb0a8f75a011aba7063810bea2ec3db 100755 (executable)
@@ -258,7 +258,7 @@ OSD_Host :: OSD_Host () {
   nSize                         = MAX_COMPUTERNAME_LENGTH + 1;
   osVerInfo.dwOSVersionInfoSize = sizeof ( OSVERSIONINFO );
 
-  ZeroMemory (  szHostName, sizeof ( hostName )  );
+  ZeroMemory (  szHostName, sizeof ( Standard_Character ) *  (MAX_COMPUTERNAME_LENGTH + 1) );
 
   if (  !GetVersionEx ( &osVerInfo )  ) {