PATCH: buffer overflow in GetSystemInfo

Marcus Meissner meissner at suse.de
Fri Jun 17 08:47:42 CDT 2005


Hi,

Embarassing.

Ciao, Marcus

Changelog:
	Specify enough buffer for id[] (20 chars are not enough).

Index: dlls/kernel/cpu.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/cpu.c,v
retrieving revision 1.13
diff -u -r1.13 cpu.c
--- dlls/kernel/cpu.c	18 May 2005 18:20:23 -0000	1.13
+++ dlls/kernel/cpu.c	17 Jun 2005 13:46:17 -0000
@@ -145,14 +145,14 @@
     {
         for (i = 0; i < info->dwNumberOfProcessors; i++)
         {
-            char num[10], id[20];
+            char num[10], id[60];
 
             attr.RootDirectory = cpu_key;
             sprintf( num, "%d", i );
             RtlCreateUnicodeStringFromAsciiz( &nameW, num );
             if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ))
             {
-                WCHAR idW[40];
+                WCHAR idW[60];
                 DWORD cpuMHz = cpuHz / 1000000;
 
                 /*TODO: report 64bit processors properly*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050617/2f7e0300/attachment.pgp


More information about the wine-patches mailing list