Przeglądaj źródła

[settings] Fix broken assertion in fetch_string_setting_copy()

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
tags/v0.9.8
Michael Brown 15 lat temu
rodzic
commit
5bd32315d0
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3
    2
      src/core/settings.c

+ 3
- 2
src/core/settings.c Wyświetl plik

@@ -448,7 +448,7 @@ int fetch_string_setting_copy ( struct settings *settings,
448 448
 				struct setting *setting,
449 449
 				char **data ) {
450 450
 	int len;
451
-	int check_len;
451
+	int check_len = 0;
452 452
 
453 453
 	len = fetch_setting_len ( settings, setting );
454 454
 	if ( len < 0 )
@@ -458,7 +458,8 @@ int fetch_string_setting_copy ( struct settings *settings,
458 458
 	if ( ! *data )
459 459
 		return -ENOMEM;
460 460
 
461
-	fetch_string_setting ( settings, setting, *data, ( len + 1 ) );
461
+	check_len = fetch_string_setting ( settings, setting, *data,
462
+					   ( len + 1 ) );
462 463
 	assert ( check_len == len );
463 464
 	return len;
464 465
 }

Ładowanie…
Anuluj
Zapisz