twain_32: Avoid using an uninitialized variable in the failure path in path in a couple of cases. (RESEND)

Gerald Pfeifer gerald at pfeifer.com
Sat Feb 28 07:39:34 CST 2015


Any problem with this patch?

---------- Forwarded message ----------
From: Gerald Pfeifer <gerald at pfeifer.com>
To: wine-patches at winehq.org
Date: Fri, 6 Feb 2015 22:11:30 +0100 (CET)
Subject: twain_32: Avoid using an uninitialized variable in the failure path in
    path in a couple of cases.

Alternatively we could initialize actual_support in those four
cases; let me know if you prefer such a patch:

  dsm.c:189:24: warning: 'actual_support' may be used uninitialized in this function [-Wmaybe-uninitialized]
  dsm.c:458:24: warning: 'actual_support' may be used uninitialized in this function [-Wmaybe-uninitialized]
  dsm.c:382:24: warning: 'actual_support' may be used uninitialized in this function [-Wmaybe-uninitialized]
  dsm.c:556:9: warning: 'actual_support' may be used uninitialized in this function [-Wmaybe-uninitialized]

Gerald

---
 dlls/twain_32/tests/dsm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/twain_32/tests/dsm.c b/dlls/twain_32/tests/dsm.c
index b8f1c9e..ab6e84f 100644
--- a/dlls/twain_32/tests/dsm.c
+++ b/dlls/twain_32/tests/dsm.c
@@ -71,6 +71,8 @@ static BOOL get_onevalue(TW_HANDLE hcontainer, TW_UINT32 *ret, TW_UINT16 *type)
         GlobalUnlock(hcontainer);
         return TRUE;
     }
+    else
+        *ret = 0;
     return FALSE;
 }
 
-- 
2.2.1



More information about the wine-patches mailing list