GetCPInfo NULL check

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Fri Mar 18 14:05:41 CST 2005


ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    GetCPInfo should return FALSE if called with NULL info buffer
-------------- next part --------------
Index: dlls/kernel/locale.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/locale.c,v
retrieving revision 1.56
diff -u -p -r1.56 locale.c
--- dlls/kernel/locale.c	19 Jan 2005 20:59:32 -0000	1.56
+++ dlls/kernel/locale.c	18 Mar 2005 20:03:05 -0000
@@ -1302,7 +1302,15 @@ BOOL WINAPI IsDBCSLeadByte( BYTE testcha
  */
 BOOL WINAPI GetCPInfo( UINT codepage, LPCPINFO cpinfo )
 {
-    const union cptable *table = get_codepage_table( codepage );
+    const union cptable *table;
+
+    if (!codepage)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+
+    table = get_codepage_table( codepage );
 
     if (!table)
     {


More information about the wine-patches mailing list