Fixed strnlen issues.

This commit is contained in:
Armin Novak 2019-11-05 14:55:33 +01:00
parent b7a12474dc
commit d7877186d6
2 changed files with 3 additions and 3 deletions

View File

@ -749,7 +749,7 @@ static BOOL nego_read_request_token_or_cookie(rdpNego* nego, wStream* s)
remain = Stream_GetRemainingLength(s);
Stream_Write_UINT16(s, 0);
if (strnlen((char*)str, remain) == len)
if (strnlen((char*)str, len) == len)
{
if (isToken)
result = nego_set_routing_token(nego, str, len);

View File

@ -449,7 +449,7 @@ static void string_list_allocate(string_list* list, int allocate_count)
{
if (!list->strings && list->allocated == 0)
{
list->strings = calloc(allocate_count, sizeof(list->strings[0]));
list->strings = calloc((size_t)allocate_count, sizeof(char*));
list->allocated = list->strings ? allocate_count : -1;
list->count = 0;
}
@ -741,7 +741,7 @@ char** crypto_cert_get_dns_names(X509* x509, int* count, int** lengths)
for (i = 0; i < list.count; i ++)
{
result[i] = list.strings[i];
(*lengths)[i] = strnlen(result[i], sizeof(*result));
(*lengths)[i] = strlen(result[i]);
}
string_list_free(&list);