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/??/??)
|
ver 0.15.1 (2009/??/??)
|
||||||
* commands:
|
* commands:
|
||||||
- don't resume playback when stopping during pause
|
- don't resume playback when stopping during pause
|
||||||
|
* database: fixed NULL pointer dereference after charset change
|
||||||
|
|
||||||
|
|
||||||
ver 0.15 (2009/06/23)
|
ver 0.15 (2009/06/23)
|
||||||
|
|
|
@ -318,10 +318,11 @@ db_load(GError **error)
|
||||||
if (old_charset != NULL
|
if (old_charset != NULL
|
||||||
&& strcmp(new_charset, old_charset)) {
|
&& strcmp(new_charset, old_charset)) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
g_message("Existing database has charset \"%s\" "
|
g_set_error(error, db_quark(), 0,
|
||||||
"instead of \"%s\"; "
|
"Existing database has charset "
|
||||||
"discarding database file",
|
"\"%s\" instead of \"%s\"; "
|
||||||
new_charset, old_charset);
|
"discarding database file",
|
||||||
|
new_charset, old_charset);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue