Skip to content

Commit

Permalink
[settings] Fix broken assertion in fetch_string_setting_copy()
Browse files Browse the repository at this point in the history
Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
  • Loading branch information
Michael Brown committed Mar 26, 2009
1 parent 1c67623 commit 5bd3231
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/settings.c
Expand Up @@ -448,7 +448,7 @@ int fetch_string_setting_copy ( struct settings *settings,
struct setting *setting,
char **data ) {
int len;
int check_len;
int check_len = 0;

len = fetch_setting_len ( settings, setting );
if ( len < 0 )
Expand All @@ -458,7 +458,8 @@ int fetch_string_setting_copy ( struct settings *settings,
if ( ! *data )
return -ENOMEM;

fetch_string_setting ( settings, setting, *data, ( len + 1 ) );
check_len = fetch_string_setting ( settings, setting, *data,
( len + 1 ) );
assert ( check_len == len );
return len;
}
Expand Down

0 comments on commit 5bd3231

Please sign in to comment.