]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointer
authorMichael Brown <mcb30@ipxe.org>
Thu, 3 Mar 2011 17:13:44 +0000 (17:13 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 3 Mar 2011 17:13:44 +0000 (17:13 +0000)
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>
src/core/settings.c

index da662e6168899ff6ddb17356b00d5eda149377a7..1f22ea45f9eb3c436178e72772c81fa8b08d8e1d 100644 (file)
@@ -632,6 +632,8 @@ int fetch_string_setting_copy ( struct settings *settings,
        int len;
        int check_len = 0;
 
+       *data = NULL;
+
        len = fetch_setting_len ( settings, setting );
        if ( len < 0 )
                return len;