PATCH - VerQueryValueA/W value check

Steven Edwards winehacker at gmail.com
Thu Jul 26 14:28:57 CDT 2007


This patch is known to fix a crash in MirandaIM and may fix a crash I
am seeing in Shockwave running the Rosetta Stone.

-- 
Steven Edwards

"There is one thing stronger than all the armies in the world, and
that is an idea whose time has come." - Victor Hugo
-------------- next part --------------
From 0904827399fa2396e78ce01797c1cdc87a5216ea Mon Sep 17 00:00:00 2001
From: Steven Edwards <winehacker at gmail.com>
Date: Thu, 26 Jul 2007 15:42:16 -0400
Subject: [PATCH] Fix a crash when bad data is passed to VerQueryValueA/W
based on patch by Christoph von Wittich <Christoph at ApiViewer.de>
---
 dlls/version/info.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/version/info.c b/dlls/version/info.c
index 82ca86f..907cd23 100644
--- a/dlls/version/info.c
+++ b/dlls/version/info.c
@@ -771,6 +771,9 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlo
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
 
+     if (!pBlock)
+        return FALSE;
+
     if ( !VersionInfoIs16( info ) )
     {
         BOOL ret;
@@ -823,6 +826,9 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlo
     TRACE("(%p,%s,%p,%p)\n",
                 pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
 
+    if (!pBlock)
+        return FALSE;
+
     if ( VersionInfoIs16( info ) )
     {
         BOOL ret;
-- 
1.4.1


More information about the wine-patches mailing list