Explorar el Código

[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 hace 15 años
padre
commit
09695f7be9
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2
    0
      src/core/settings.c

+ 2
- 0
src/core/settings.c Ver fichero

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

Loading…
Cancelar
Guardar