From 223e7616b87be976fcacfa9b680b3234f22443a5 Mon Sep 17 00:00:00 2001 From: "imen.bhiri" Date: Thu, 18 Feb 2016 16:18:49 +0100 Subject: [PATCH] Ticket 8609: SPA of many parameters causes segmentation fault --- dm/dmcwmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/dmcwmp.c b/dm/dmcwmp.c index 61644f6..d670858 100644 --- a/dm/dmcwmp.c +++ b/dm/dmcwmp.c @@ -259,7 +259,7 @@ void add_list_enabled_notify(char *param, char *notification, char *value) dm_enabled_notify = calloc(1, sizeof(struct param_fault)); // Should be calloc and not dmcalloc list_add_tail(&dm_enabled_notify->list, &list_enabled_notify); dm_enabled_notify->name = strdup(param); // Should be strdup and not dmstrdup - dm_enabled_notify->value = strdup(value); // Should be strdup and not dmstrdup + dm_enabled_notify->value = value ? strdup(value) : strdup(""); dm_enabled_notify->notification = strdup(notification); // Should be strdup and not dmstrdup } @@ -270,7 +270,7 @@ void add_list_enabled_lwnotify(char *param, char *notification, char *value) dm_enabled_notify = calloc(1, sizeof(struct param_fault)); // Should be calloc and not dmcalloc list_add_tail(&dm_enabled_notify->list, &list_enabled_lw_notify); dm_enabled_notify->name = strdup(param); // Should be strdup and not dmstrdup - dm_enabled_notify->value = strdup(value); // Should be strdup and not dmstrdup + dm_enabled_notify->value = value ? strdup(value) : strdup(""); // Should be strdup and not dmstrdup dm_enabled_notify->notification = strdup(notification); // Should be strdup and not dmstrdup } void del_list_enabled_notify(struct dm_enabled_notify *dm_enabled_notify)