Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f0dc9def
Commit
f0dc9def
authored
Aug 03, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Aug 03, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Ensure that a returned free block is valid in storage.
Otherwise, an IStream_SetSize call followed by an IStream_Read call could fail with STG_E_DOCFILECORRUPT.
parent
6455b9e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
stg_bigblockfile.c
dlls/ole32/stg_bigblockfile.c
+24
-4
storage32.c
dlls/ole32/storage32.c
+5
-0
storage32.h
dlls/ole32/storage32.h
+1
-0
No files found.
dlls/ole32/stg_bigblockfile.c
View file @
f0dc9def
...
...
@@ -351,12 +351,11 @@ void* BIGBLOCKFILE_GetROBigBlock(
}
/******************************************************************************
* BIGBLOCKFILE_
GetBigBlock
* BIGBLOCKFILE_
EnsureExists
*
* Returns the specified block.
* Will grow the file if necessary.
* Grows the file if necessary to make sure the block is valid.
*/
void
*
BIGBLOCKFILE_GetBigBlock
(
LPBIGBLOCKFILE
This
,
ULONG
index
)
void
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
)
{
/*
* block index starts at -1
...
...
@@ -379,6 +378,27 @@ void* BIGBLOCKFILE_GetBigBlock(LPBIGBLOCKFILE This, ULONG index)
BIGBLOCKFILE_SetSize
(
This
,
newSize
);
}
}
/******************************************************************************
* BIGBLOCKFILE_GetBigBlock
*
* Returns the specified block.
* Will grow the file if necessary.
*/
void
*
BIGBLOCKFILE_GetBigBlock
(
LPBIGBLOCKFILE
This
,
ULONG
index
)
{
/* FIXME: is this necessary? */
BIGBLOCKFILE_EnsureExists
(
This
,
index
);
/*
* block index starts at -1
* translate to zero based index
*/
if
(
index
==
0xffffffff
)
index
=
0
;
else
index
++
;
return
BIGBLOCKFILE_GetBigBlockPointer
(
This
,
index
,
FILE_MAP_WRITE
);
}
...
...
dlls/ole32/storage32.c
View file @
f0dc9def
...
...
@@ -2717,6 +2717,11 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
depotBlockOffset
=
0
;
}
/*
* make sure that the block physically exists before using it
*/
BIGBLOCKFILE_EnsureExists
(
This
->
bigBlockFile
,
freeBlock
);
This
->
prevFreeBlock
=
freeBlock
;
return
freeBlock
;
...
...
dlls/ole32/storage32.h
View file @
f0dc9def
...
...
@@ -190,6 +190,7 @@ BigBlockFile* BIGBLOCKFILE_Construct(HANDLE hFile,
ULONG
blocksize
,
BOOL
fileBased
);
void
BIGBLOCKFILE_Destructor
(
LPBIGBLOCKFILE
This
);
void
BIGBLOCKFILE_EnsureExists
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
void
*
BIGBLOCKFILE_GetBigBlock
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
void
*
BIGBLOCKFILE_GetROBigBlock
(
LPBIGBLOCKFILE
This
,
ULONG
index
);
void
BIGBLOCKFILE_ReleaseBigBlock
(
LPBIGBLOCKFILE
This
,
void
*
pBlock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment