#define PATH_AMD_SOCK "/run/aul/daemons/.amd-sock"
#define PATH_DEV_NULL "/dev/null"
#define MAX_TEP_IS_MOUNT_RETRY_CNT 100
+#define MAX_PAYLOAD_SIZE (1024 * 1024 * 1)
#define TEP_BUS_NAME "org.tizen.system.deviced"
#define TEP_OBJECT_PATH "/Org/Tizen/System/DeviceD/Tzip"
memcpy(&datalen, buf + sizeof(int), sizeof(int));
memcpy(&opt, buf + sizeof(int) + sizeof(int), sizeof(int));
+ if (datalen < 0 || datalen > MAX_PAYLOAD_SIZE) {
+ _E("Invalid protocol. datalen(%d)", datalen);
+ return NULL;
+ }
+
/* allocate for a null byte */
pkt = (app_pkt_t *)calloc(1, AUL_PKT_HEADER_SIZE + datalen + 1);
if (pkt == NULL) {