mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Check return value of malloc
This commit is contained in:
@@ -1471,6 +1471,10 @@ BOOL gcc_write_server_security_data(wStream* s, rdpMcs* mcs)
|
||||
Stream_Write_UINT32(s, serverCertLen); /* serverCertLen */
|
||||
settings->ServerRandomLength = serverRandomLen;
|
||||
settings->ServerRandom = (BYTE*) malloc(serverRandomLen);
|
||||
if (!settings->ServerRandom)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
winpr_RAND(settings->ServerRandom, serverRandomLen);
|
||||
Stream_Write(s, settings->ServerRandom, serverRandomLen);
|
||||
sigData = Stream_Pointer(s);
|
||||
|
||||
Reference in New Issue
Block a user