Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
BaseTools: Fix UEFI and Tiano Decompression logic issue
Browse files Browse the repository at this point in the history
https://bugzilla.tianocore.org/show_bug.cgi?id=1317

This is a regression issue caused by 041d89b.
In Decode() function, once mOutBuf is fully filled, Decode() should return.
Current logic misses the checker of mOutBuf after while() loop.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>
  • Loading branch information
lgao4 committed Nov 11, 2018
1 parent 114a75a commit 5e45a1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions BaseTools/Source/C/Common/Decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ Returns: (VOID)

BytesRemain--;
}
//
// Once mOutBuf is fully filled, directly return
//
if (Sd->mOutBuf >= Sd->mOrigSize) {
return ;
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions BaseTools/Source/C/TianoCompress/TianoCompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -2682,6 +2682,12 @@ Returns: (VOID)

BytesRemain--;
}
//
// Once mOutBuf is fully filled, directly return
//
if (Sd->mOutBuf >= Sd->mOrigSize) {
goto Done ;
}
}
}

Expand Down

0 comments on commit 5e45a1f

Please sign in to comment.