conf: don't allow a NULL config name

No functional changes, this is enforced by the only in-tree callers of
pw_conf_load_conf() but let's enforce this properly.
This commit is contained in:
Peter Hutterer 2021-07-06 12:00:34 +10:00 committed by Wim Taymans
parent fb2d35895e
commit bba9edabee
2 changed files with 22 additions and 2 deletions

View file

@ -254,6 +254,11 @@ static int conf_load(const char *prefix, const char *name, struct pw_properties
struct stat sbuf;
int fd;
if (name == NULL) {
pw_log_debug(NAME" %p: config name must not be NULL", conf);
return -EINVAL;
}
if (get_read_path(path, sizeof(path), prefix, name) == 0) {
pw_log_debug(NAME" %p: can't load config '%s': %m", conf, path);
return -ENOENT;