mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[libfreerdp] Fix TestFuzzCommonAssistanceHexStringToBin
Test breaks contract in freerdp_assistance_hex_string_to_bin(): function expects zero-terminated string. Patch fixes that.
This commit is contained in:
committed by
akallabeth
parent
d8254c5ff3
commit
3266dc984a
@@ -2,8 +2,15 @@
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
|
||||
{
|
||||
BYTE* pass = freerdp_assistance_hex_string_to_bin((void*)Data, &Size);
|
||||
char* buf = calloc(Size + 1, sizeof(char));
|
||||
if (buf == NULL)
|
||||
return 0;
|
||||
memcpy(buf, Data, Size);
|
||||
buf[Size] = '\0';
|
||||
|
||||
BYTE* pass = freerdp_assistance_hex_string_to_bin((void*)buf, &Size);
|
||||
free(pass);
|
||||
free(buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user