[1/2] msi: Always check the return value of msi_string2idW.

Hans Leidekker hans at codeweavers.com
Wed Sep 29 02:58:02 CDT 2010


---
 dlls/msi/join.c     |    6 ++++--
 dlls/msi/storages.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/join.c b/dlls/msi/join.c
index f787c30..5e11577 100644
--- a/dlls/msi/join.c
+++ b/dlls/msi/join.c
@@ -225,10 +225,12 @@ static UINT JOIN_get_column_info( struct tagMSIVIEW *view,
 static UINT join_find_row( MSIJOINVIEW *jv, MSIRECORD *rec, UINT *row )
 {
     LPCWSTR str;
-    UINT i, id, data;
+    UINT r, i, id, data;
 
     str = MSI_RecordGetString( rec, 1 );
-    msi_string2idW( jv->db->strings, str, &id );
+    r = msi_string2idW( jv->db->strings, str, &id );
+    if (r != ERROR_SUCCESS)
+        return r;
 
     for (i = 0; i < jv->rows; i++)
     {
diff --git a/dlls/msi/storages.c b/dlls/msi/storages.c
index 3e88874..56f252f 100644
--- a/dlls/msi/storages.c
+++ b/dlls/msi/storages.c
@@ -334,10 +334,12 @@ static UINT STORAGES_get_column_info(struct tagMSIVIEW *view, UINT n,
 static UINT storages_find_row(MSISTORAGESVIEW *sv, MSIRECORD *rec, UINT *row)
 {
     LPCWSTR str;
-    UINT i, id, data;
+    UINT r, i, id, data;
 
     str = MSI_RecordGetString(rec, 1);
-    msi_string2idW(sv->db->strings, str, &id);
+    r = msi_string2idW(sv->db->strings, str, &id);
+    if (r != ERROR_SUCCESS)
+        return r;
 
     for (i = 0; i < sv->num_rows; i++)
     {
-- 
1.7.0.4







More information about the wine-patches mailing list