Juan Lang : setupapi: Return FALSE if a NULL buffer is passed in.

Alexandre Julliard julliard at winehq.org
Thu Oct 25 08:38:46 CDT 2007


Module: wine
Branch: master
Commit: 4d3853ce9f6e55a2a8431bc1610e3aa382ff2e3e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4d3853ce9f6e55a2a8431bc1610e3aa382ff2e3e

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Oct 24 10:37:29 2007 -0700

setupapi: Return FALSE if a NULL buffer is passed in.

---

 dlls/setupapi/devinst.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index bd58791..531597d 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -3065,7 +3065,9 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(
 
         if (RequiredSize)
             *RequiredSize = size;
-        if (!l)
+        if (!PropertyBuffer)
+            ; /* do nothing, ret is already FALSE, last error is already set */
+        else if (!l)
             ret = TRUE;
         else
             SetLastError(l);
@@ -3119,7 +3121,9 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
 
         if (RequiredSize)
             *RequiredSize = size;
-        if (!l)
+        if (!PropertyBuffer)
+            ; /* do nothing, ret is already FALSE, last error is already set */
+        else if (!l)
             ret = TRUE;
         else
             SetLastError(l);




More information about the wine-cvs mailing list