pa_namereg_is_valid_name() will hit an assertion if the name string is
NULL. Maybe it would make sense to change pa_namereg_is_valid_name() so
that it would return false on NULL, but I didn't want to change the
function semantics at this time.
e->device and e->card can be NULL even when device_valid and card_valid
are set to true if the database contains bad data.
I ran into this crash while developing new code, I haven't seen the
crash in the wild.
if (!pa_tagstruct_eof(t))
goto fail;
- if (e->device_valid && !pa_namereg_is_valid_name(e->device)) {
+ if (e->device_valid && (!e->device || !pa_namereg_is_valid_name(e->device))) {
pa_log_warn("Invalid device name stored in database for stream %s", name);
goto fail;
}
- if (e->card_valid && !pa_namereg_is_valid_name(e->card)) {
+ if (e->card_valid && (!e->card || !pa_namereg_is_valid_name(e->card))) {
pa_log_warn("Invalid card name stored in database for stream %s", name);
goto fail;
}