Skip to content

Commit

Permalink
Merge pull request #6019 from akallabeth/bound_access_fixes
Browse files Browse the repository at this point in the history
Fix issues with boundary access.
  • Loading branch information
nfedera committed Apr 6, 2020
2 parents e3b3b52 + 6f00add commit c367f65
Show file tree
Hide file tree
Showing 10 changed files with 419 additions and 379 deletions.
5 changes: 3 additions & 2 deletions libfreerdp/cache/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,12 @@ rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
bitmapCache->settings = settings;
bitmapCache->update = ((freerdp*)settings->instance)->update;
bitmapCache->context = bitmapCache->update->context;
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
bitmapCache->cells = (BITMAP_V2_CELL*)calloc(bitmapCache->maxCells, sizeof(BITMAP_V2_CELL));
bitmapCache->cells =
(BITMAP_V2_CELL*)calloc(settings->BitmapCacheV2NumCells, sizeof(BITMAP_V2_CELL));

if (!bitmapCache->cells)
goto fail;
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;

for (i = 0; i < (int)bitmapCache->maxCells; i++)
{
Expand Down
2 changes: 2 additions & 0 deletions libfreerdp/core/autodetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ static BOOL autodetect_recv_bandwidth_measure_results(rdpRdp* rdp, wStream* s,
return FALSE;

WLog_VRB(AUTODETECT_TAG, "received Bandwidth Measure Results PDU");
if (Stream_GetRemainingLength(s) < 8)
return -1;
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureTimeDelta); /* timeDelta (4 bytes) */
Stream_Read_UINT32(s, rdp->autodetect->bandwidthMeasureByteCount); /* byteCount (4 bytes) */

Expand Down
Loading

0 comments on commit c367f65

Please sign in to comment.