Set the out buffer count to zero on read error.
authorUlrich Czekalla <ulrich@codeweavers.com>
Mon, 6 Dec 2004 16:18:22 +0000 (16:18 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 6 Dec 2004 16:18:22 +0000 (16:18 +0000)
dlls/msi/record.c

index 84a363e21dc241fcf6a6a66686804dce93f28faa..a9a32adcee56be487810b63346dd075b2b12f311 100644 (file)
@@ -534,7 +534,10 @@ UINT MSI_RecordReadStream(MSIRECORD *rec, unsigned int iField, char *buf, DWORD
     count = 0;
     r = IStream_Read( stm, buf, *sz, &count );
     if( FAILED( r ) )
+    {
+        *sz = 0;
         return ERROR_FUNCTION_FAILED;
+    }
 
     *sz = count;