[pulseaudio-commits] src/modules
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Fri Apr 29 12:53:27 UTC 2016
src/modules/module-stream-restore.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 1a1d5086ade973a23872ac1cd42cd9d36943b71c
Author: Juho Hämäläinen <jusa at hilvi.org>
Date: Tue Apr 26 16:11:44 2016 +0300
stream-restore: With dbus-proto fix segfault if e->device is NULL.
If first part of test is false and e->device is NULL pa_streq will
segfault. Fix by using pa_safe_streq, which checks strings for NULL
before doing strcmp.
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 37555a8..d1c2597 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -645,7 +645,7 @@ static void handle_add_entry(DBusConnection *conn, DBusMessage *msg, void *userd
e->channel_map = map;
e->volume_valid = !!map.channels;
- device_updated = (e->device_valid != !!device[0]) || !pa_streq(e->device, device);
+ device_updated = (e->device_valid != !!device[0]) || !pa_safe_streq(e->device, device);
pa_xfree(e->device);
e->device = pa_xstrdup(device);
e->device_valid = !!device[0];
@@ -757,7 +757,7 @@ static void handle_entry_set_device(DBusConnection *conn, DBusMessage *msg, DBus
pa_assert_se(e = entry_read(de->userdata, de->entry_name));
- updated = (e->device_valid != !!device[0]) || !pa_streq(e->device, device);
+ updated = (e->device_valid != !!device[0]) || !pa_safe_streq(e->device, device);
if (updated) {
pa_xfree(e->device);
More information about the pulseaudio-commits
mailing list