[winpr,stream] use new Stream_CheckAndLogRequiredLength*

This commit is contained in:
akallabeth
2023-01-24 14:53:36 +01:00
committed by akallabeth
parent de40b43037
commit 075506f6c8
25 changed files with 55 additions and 48 deletions

View File

@@ -92,7 +92,7 @@ static UINT encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str)
return ERROR_INVALID_DATA;
}
if (!Stream_CheckAndLogRequiredLength(TAG, s, sizeof(WCHAR) * str->cchString))
if (!Stream_CheckAndLogRequiredLengthOfSize(TAG, s, str->cchString, sizeof(WCHAR)))
return ERROR_INVALID_DATA;
Stream_Read(s, &(str->wString), (str->cchString * 2)); /* String (variable) */

View File

@@ -67,7 +67,7 @@ static int encomsp_read_unicode_string(wStream* s, ENCOMSP_UNICODE_STRING* str)
if (str->cchString > 1024)
return -1;
if (!Stream_CheckAndLogRequiredLength(TAG, s, (str->cchString * 2ull)))
if (!Stream_CheckAndLogRequiredLengthOfSize(TAG, s, str->cchString, sizeof(WCHAR)))
return -1;
Stream_Read(s, &(str->wString), (str->cchString * 2)); /* String (variable) */