[PATCH] cabinet: Properly initialize our internal fci structure v2(bug 36115)(valgrind)

Detlef Riekenberg wine.dev at web.de
Mon Nov 14 16:46:38 CST 2016


We did not initialize all items for our internal fci structure.
This should fix bug 36115

v2:
Remove comments, as suggested by Huw

--
bye bye ... Detlef

Signed-off-by: Detlef Riekenberg <wine.dev at web.de>
---
 dlls/cabinet/fci.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c
index 70d4f3f..03fbf46 100644
--- a/dlls/cabinet/fci.c
+++ b/dlls/cabinet/fci.c
@@ -1036,6 +1036,7 @@ HFCI __cdecl FCICreate(
     return NULL;
   }
 
+  memset(p_fci_internal, 0, sizeof(FCI_Int));
   p_fci_internal->magic = FCI_INT_MAGIC;
   p_fci_internal->perf = perf;
   p_fci_internal->fileplaced = pfnfiledest;
@@ -1050,26 +1051,8 @@ HFCI __cdecl FCICreate(
   p_fci_internal->gettemp = pfnfcigtf;
   p_fci_internal->ccab = *pccab;
   p_fci_internal->pccab = pccab;
-  p_fci_internal->fPrevCab = FALSE;
-  p_fci_internal->fNextCab = FALSE;
-  p_fci_internal->fSplitFolder = FALSE;
-  p_fci_internal->fGetNextCabInVain = FALSE;
   p_fci_internal->pv = pv;
-  p_fci_internal->cdata_in = 0;
-  p_fci_internal->cCompressedBytesInFolder = 0;
-  p_fci_internal->cFolders = 0;
-  p_fci_internal->cFiles = 0;
-  p_fci_internal->cDataBlocks = 0;
   p_fci_internal->data.handle = -1;
-  p_fci_internal->fNewPrevious = FALSE;
-  p_fci_internal->estimatedCabinetSize = 0;
-  p_fci_internal->statusFolderTotal = 0;
-  p_fci_internal->folders_size = 0;
-  p_fci_internal->files_size = 0;
-  p_fci_internal->placed_files_size = 0;
-  p_fci_internal->pending_data_size = 0;
-  p_fci_internal->folders_data_size = 0;
-  p_fci_internal->compression = tcompTYPE_NONE;
   p_fci_internal->compress = compress_NONE;
 
   list_init( &p_fci_internal->folders_list );
-- 
2.7.4




More information about the wine-patches mailing list