Fix memory corruption 45/184445/2
authormk5004.lee <mk5004.lee@samsung.com>
Wed, 18 Jul 2018 04:46:03 +0000 (13:46 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Wed, 18 Jul 2018 07:40:25 +0000 (16:40 +0900)
- Check the index first.
  From patch : Fixed to allocated memory as many as deleted

Change-Id: I81f72d997645662b9f44887d8a8e70a8ac83fbbf
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
src/notification_ipc.c

index 4f24964..14fe889 100644 (file)
@@ -484,7 +484,7 @@ static void _delete_multiple_notify(GVariant *parameters)
                return;
        }
 
-       while (g_variant_iter_loop(iter, "(i)", &buf[idx]) && idx < num) {
+       while (idx < num && g_variant_iter_loop(iter, "(i)", &buf[idx])) {
                DBG("priv id[%d]", buf[idx]);
                idx++;
        }