[PATCH] cabinet: Properly initialize our internal fci structure (bug 36115)(valgrind)
Detlef Riekenberg
wine.dev at web.de
Sun Nov 13 16:58:57 CST 2016
We did not initialize all items for our internal fci structure.
This should fix bug 36115
--
bye bye ... Detlef
Signed-off-by: Detlef Riekenberg <wine.dev at web.de>
---
dlls/cabinet/fci.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c
index 70d4f3f..5f2e4e7 100644
--- a/dlls/cabinet/fci.c
+++ b/dlls/cabinet/fci.c
@@ -1036,6 +1036,8 @@ HFCI __cdecl FCICreate(
return NULL;
}
+ /* start with a clean structure */
+ 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 +1052,9 @@ 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;
+ /* the memset selected 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