mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-25 04:24:47 -04:00
Fix recursion in UEFIReplace
This commit is contained in:
parent
b5961a7155
commit
dd90367387
1 changed files with 3 additions and 2 deletions
|
@ -84,17 +84,18 @@ UINT8 UEFIReplace::replaceInFile(const QModelIndex & index, const QByteArray & g
|
|||
{
|
||||
if (!model || !index.isValid())
|
||||
return ERR_INVALID_PARAMETER;
|
||||
bool patched = false;
|
||||
if (model->subtype(index) == sectionType) {
|
||||
QModelIndex fileIndex = model->findParentOfType(index, Types::File);
|
||||
QByteArray fileGuid = model->header(fileIndex).left(sizeof(EFI_GUID));
|
||||
if (fileGuid == guid) {
|
||||
if (fileGuid == guid && model->action(index) != Actions::Replace) {
|
||||
UINT8 result = ffsEngine->replace(index, newData, REPLACE_MODE_BODY);
|
||||
if (replaceOnce || (result != ERR_SUCCESS && result != ERR_NOTHING_TO_PATCH))
|
||||
return result;
|
||||
patched = result == ERR_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
bool patched = false;
|
||||
if (model->rowCount(index) > 0) {
|
||||
for (int i = 0; i < model->rowCount(index); i++) {
|
||||
UINT8 result = replaceInFile(index.child(i, 0), guid, sectionType, newData, replaceOnce);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue