database: fixed NULL pointer dereference after charset change
When the filesystem_charset is changed in mpd.conf, MPD should discard the old database. In this error branch, MPD did not fill the GError object properly, and logged a warning message instead, which caused a segmentation fault.
This commit is contained in:
parent
5b9dfbe353
commit
15d4c841ce
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
|||
ver 0.15.1 (2009/??/??)
|
||||
* commands:
|
||||
- don't resume playback when stopping during pause
|
||||
* database: fixed NULL pointer dereference after charset change
|
||||
|
||||
|
||||
ver 0.15 (2009/06/23)
|
||||
|
|
|
@ -318,10 +318,11 @@ db_load(GError **error)
|
|||
if (old_charset != NULL
|
||||
&& strcmp(new_charset, old_charset)) {
|
||||
fclose(fp);
|
||||
g_message("Existing database has charset \"%s\" "
|
||||
"instead of \"%s\"; "
|
||||
"discarding database file",
|
||||
new_charset, old_charset);
|
||||
g_set_error(error, db_quark(), 0,
|
||||
"Existing database has charset "
|
||||
"\"%s\" instead of \"%s\"; "
|
||||
"discarding database file",
|
||||
new_charset, old_charset);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue