mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-24 07:54:39 +00:00
Merge pull request #918 from Morilli/fix-bzip2-selector-oob
[bzip2] fix possible out of bounds access due to unsanitized nSelectors usage
This commit is contained in:
@@ -542,9 +542,14 @@ internal class CBZip2InputStream : Stream
|
||||
{
|
||||
j++;
|
||||
}
|
||||
selectorMtf[i] = (char)j;
|
||||
if (i < BZip2Constants.MAX_SELECTORS)
|
||||
{
|
||||
selectorMtf[i] = (char)j;
|
||||
}
|
||||
}
|
||||
|
||||
nSelectors = Math.Min(nSelectors, BZip2Constants.MAX_SELECTORS);
|
||||
|
||||
/* Undo the MTF values for the selectors. */
|
||||
{
|
||||
var pos = new char[BZip2Constants.N_GROUPS];
|
||||
|
||||
Reference in New Issue
Block a user