瀏覽代碼

Zeroing out memory before using it can be so important.

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
13d9a660ca
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      src/core/resolv.c

+ 1
- 0
src/core/resolv.c 查看文件

@@ -56,6 +56,7 @@ int resolv ( const char *name, struct sockaddr *sa, struct async *parent ) {
56 56
 	resolution = malloc ( sizeof ( *resolution ) );
57 57
 	if ( ! resolution )
58 58
 		return -ENOMEM;
59
+	memset ( resolution, 0, sizeof ( *resolution ) );
59 60
 	async_init ( &resolution->async, &resolv_async_operations, parent );
60 61
 
61 62
 	/* Check for a dotted quad IP address first */

Loading…
取消
儲存