GetCPInfo should return FALSE if called with NULL info buffer.

diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c
index fb5eab8..c755984 100644
--- a/dlls/kernel/locale.c
+++ b/dlls/kernel/locale.c
@@ -1302,9 +1302,15 @@
  */
 BOOL WINAPI GetCPInfo( UINT codepage, LPCPINFO cpinfo )
 {
-    const union cptable *table = get_codepage_table( codepage );
+    const union cptable *table;
 
-    if (!table)
+    if (!cpinfo)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+
+    if (!(table = get_codepage_table( codepage )))
     {
         switch(codepage)
         {