mirror of
https://github.com/ipxe/ipxe
synced 2025-12-17 01:52:08 +03:00
Zeroing out memory before using it can be so important.
This commit is contained in:
@@ -56,6 +56,7 @@ int resolv ( const char *name, struct sockaddr *sa, struct async *parent ) {
|
|||||||
resolution = malloc ( sizeof ( *resolution ) );
|
resolution = malloc ( sizeof ( *resolution ) );
|
||||||
if ( ! resolution )
|
if ( ! resolution )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
memset ( resolution, 0, sizeof ( *resolution ) );
|
||||||
async_init ( &resolution->async, &resolv_async_operations, parent );
|
async_init ( &resolution->async, &resolv_async_operations, parent );
|
||||||
|
|
||||||
/* Check for a dotted quad IP address first */
|
/* Check for a dotted quad IP address first */
|
||||||
|
|||||||
Reference in New Issue
Block a user