mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 12:28:02 +02:00
conf: skip empty configuration files to avoid crashing
g_mapped_file_get_contents() returns NULL if the file is empty Fixes: #671
This commit is contained in:
parent
65e4ae83b9
commit
5235c025fe
1 changed files with 5 additions and 0 deletions
|
|
@ -216,6 +216,11 @@ open_and_load_sections (WpConf * self, const gchar *path, GError ** error)
|
|||
if (!file)
|
||||
return FALSE;
|
||||
|
||||
if (!g_mapped_file_get_contents (file) || g_mapped_file_get_length (file) == 0) {
|
||||
wp_notice_object (self, "Ignoring empty configuration file at '%s'", path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* test if the file is a relic from 0.4 */
|
||||
if (detect_old_conf_format (self, file)) {
|
||||
g_set_error (error, WP_DOMAIN_LIBRARY, WP_LIBRARY_ERROR_INVALID_ARGUMENT,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue