mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
[crypto,per] abort on invalid parameters
This commit is contained in:
@@ -333,6 +333,8 @@ BOOL per_read_integer16(wStream* s, UINT16* integer, UINT16 min)
|
||||
|
||||
BOOL per_write_integer16(wStream* s, UINT16 integer, UINT16 min)
|
||||
{
|
||||
if (min > integer)
|
||||
return FALSE;
|
||||
if (!Stream_EnsureRemainingCapacity(s, 2))
|
||||
return FALSE;
|
||||
Stream_Write_UINT16_BE(s, integer - min);
|
||||
|
||||
Reference in New Issue
Block a user