Installer: Fix use-after-free of target directory name.
When CopyEngine::_CopyFolder() would recursively call itself, the fCurrentTargetFolder would be set to the entry name of that directory. When this returned, this was never reset to the parent directory name and would eventually use a freed string when the BEntry was reused for the next entry.
This commit is contained in:
parent
f10faf61ac
commit
6990ae7b84
@ -286,7 +286,6 @@ CopyEngine::_CopyFolder(const char* _source, const char* _destination,
|
|||||||
int32& level, sem_id cancelSemaphore)
|
int32& level, sem_id cancelSemaphore)
|
||||||
{
|
{
|
||||||
level++;
|
level++;
|
||||||
fCurrentTargetFolder = _destination;
|
|
||||||
|
|
||||||
BDirectory source(_source);
|
BDirectory source(_source);
|
||||||
status_t ret = source.InitCheck();
|
status_t ret = source.InitCheck();
|
||||||
@ -332,6 +331,7 @@ CopyEngine::_CopyFolder(const char* _source, const char* _destination,
|
|||||||
|
|
||||||
fItemsCopied++;
|
fItemsCopied++;
|
||||||
fCurrentItem = name;
|
fCurrentItem = name;
|
||||||
|
fCurrentTargetFolder = _destination;
|
||||||
_UpdateProgress();
|
_UpdateProgress();
|
||||||
|
|
||||||
BEntry copy(&destination, name);
|
BEntry copy(&destination, name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user