Author: cwittich
Date: Tue Apr 17 22:58:58 2007
New Revision: 26379
URL:
http://svn.reactos.org/svn/reactos?rev=26379&view=rev
Log:
fix crash in VerQueryValueA/W
Modified:
trunk/reactos/dll/win32/version/info.c
trunk/reactos/include/psdk/winver.h
Modified: trunk/reactos/dll/win32/version/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/version/info.c?r…
==============================================================================
--- trunk/reactos/dll/win32/version/info.c (original)
+++ trunk/reactos/dll/win32/version/info.c Tue Apr 17 22:58:58 2007
@@ -764,7 +764,7 @@
/***********************************************************************
* VerQueryValueA [VERSION.@]
*/
-BOOL WINAPI VerQueryValueA( LPVOID pBlock, LPSTR lpSubBlock,
+BOOL WINAPI VerQueryValueA( LPVOID pBlock, LPCSTR lpSubBlock,
LPVOID *lplpBuffer, UINT *puLen )
{
static const char rootA[] = "\\";
@@ -773,6 +773,9 @@
TRACE("(%p,%s,%p,%p)\n",
pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
+
+ if (!pBlock)
+ return FALSE;
if ( !VersionInfoIs16( info ) )
{
@@ -811,7 +814,7 @@
/***********************************************************************
* VerQueryValueW [VERSION.@]
*/
-BOOL WINAPI VerQueryValueW( LPVOID pBlock, LPWSTR lpSubBlock,
+BOOL WINAPI VerQueryValueW( LPVOID pBlock, LPCWSTR lpSubBlock,
LPVOID *lplpBuffer, UINT *puLen )
{
static const WCHAR rootW[] = { '\\', 0 };
@@ -822,6 +825,9 @@
TRACE("(%p,%s,%p,%p)\n",
pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
+
+ if (!pBlock)
+ return FALSE;
if ( VersionInfoIs16( info ) )
{
Modified: trunk/reactos/include/psdk/winver.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winver.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winver.h (original)
+++ trunk/reactos/include/psdk/winver.h Tue Apr 17 22:58:58 2007
@@ -108,8 +108,8 @@
BOOL WINAPI GetFileVersionInfoW(LPCWSTR,DWORD,DWORD,PVOID);
DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD);
DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD);
-BOOL WINAPI VerQueryValueA(const LPVOID,LPSTR,LPVOID*,PUINT);
-BOOL WINAPI VerQueryValueW(const LPVOID,LPWSTR,LPVOID*,PUINT);
+BOOL WINAPI VerQueryValueA(const LPVOID,LPCSTR,LPVOID*,PUINT);
+BOOL WINAPI VerQueryValueW(const LPVOID,LPCWSTR,LPVOID*,PUINT);
#ifdef UNICODE
#define VerFindFile VerFindFileW
#define VerQueryValue VerQueryValueW