瀏覽代碼

[settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointer

For consistency with other functions in the fetch_setting() family,
ensure that fetch_string_setting_copy() always initialises the pointer
to the fetched setting even if fetching fails.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 年之前
父節點
當前提交
09695f7be9
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      src/core/settings.c

+ 2
- 0
src/core/settings.c 查看文件

@@ -632,6 +632,8 @@ int fetch_string_setting_copy ( struct settings *settings,
632 632
 	int len;
633 633
 	int check_len = 0;
634 634
 
635
+	*data = NULL;
636
+
635 637
 	len = fetch_setting_len ( settings, setting );
636 638
 	if ( len < 0 )
637 639
 		return len;

Loading…
取消
儲存