Skip to content

Commit

Permalink
[codec,ncrush] fix missing input length check
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Apr 16, 2024
1 parent 52d75f6 commit dbe5d52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libfreerdp/codec/ncrush.c
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,12 @@ int ncrush_decompress(NCRUSH_CONTEXT* ncrush, const BYTE* pSrcData, UINT32 SrcSi
return 1;
}

if (SrcSize < 4)
{
WLog_ERR(TAG, "Input size short: SrcSize %" PRIu32 " < 4", SrcSize);
return -1;
}

const BYTE* SrcEnd = &pSrcData[SrcSize];
const BYTE* SrcPtr = pSrcData + 4;

Expand Down

0 comments on commit dbe5d52

Please sign in to comment.