浏览代码

[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;

正在加载...
取消
保存