fix tainted int 89/76289/1 accepted/tizen/common/20160629.222150 accepted/tizen/ivi/20160624.064115 accepted/tizen/mobile/20160624.063713 accepted/tizen/tv/20160624.063734 accepted/tizen/wearable/20160624.064000 submit/tizen/20160623.110452
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 23 Jun 2016 09:09:30 +0000 (18:09 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Thu, 23 Jun 2016 09:09:30 +0000 (18:09 +0900)
Change-Id: Ib1220dfb64cb4d4030f98542791e11ef33eac3f2
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
alarm-session-agent/agent.c

index 39f93c0..172631e 100644 (file)
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <poll.h>
+#include <linux/limits.h>
 
 #include <systemd/sd-daemon.h>
 #include <bundle.h>
@@ -198,7 +199,7 @@ static gboolean _alarm_agent_main(gint fd, GIOCondition condition,
                return G_SOURCE_CONTINUE;
        }
 
-       if (len <= 0) {
+       if (len <= 0 || len > PATH_MAX) {
                close(clifd);
                return G_SOURCE_CONTINUE;
        }
@@ -226,7 +227,6 @@ static gboolean _alarm_agent_main(gint fd, GIOCondition condition,
        gv = g_variant_new_from_data(G_VARIANT_TYPE("(is)"),
                        data, len, TRUE, NULL, NULL);
 
-
        if (!gv) {
                free(data);
                close(clifd);