Commit 15d4c841 authored by Max Kellermann's avatar Max Kellermann

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.
parent 5b9dfbe3
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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment