From 21c6c704383d38125c8208711f292427ac4544ca Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 8 Jun 2012 19:36:45 +0300 Subject: [PATCH] card: Don't crash if someone gives NULL name to pa_card_set_profile(). In my opinion, pa_card_set_profile() should assert that name is not NULL, and it would be the job of the client interface to filter out NULLs from the client input, but this is done this way also when setting sink and source ports, so for consistency I'll do this this way for now. --- src/pulsecore/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index 1d0a9ead6..d1f0de830 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -228,7 +228,7 @@ int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save) { return -PA_ERR_NOTIMPLEMENTED; } - if (!c->profiles) + if (!c->profiles || !name) return -PA_ERR_NOENTITY; if (!(profile = pa_hashmap_get(c->profiles, name)))