summaryrefslogtreecommitdiff
path: root/src/bin/evas/dummy_slave.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-14 17:36:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-01-15 16:06:08 +0900
commit137383b53266d6380c0e89103a90038e1d461e86 (patch)
tree01ef5f7791c02b03b8ac16fa5a742856e17575f8 /src/bin/evas/dummy_slave.c
parentd8d5189003e59b3f68223a6cddcd025d826b6deb (diff)
Evas/cserve2: Add some safety checks when reading socket messages
Fixes CID 1039571 and 1039572.
Diffstat (limited to 'src/bin/evas/dummy_slave.c')
-rw-r--r--src/bin/evas/dummy_slave.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/evas/dummy_slave.c b/src/bin/evas/dummy_slave.c
index 9b5638053b..fb57250681 100644
--- a/src/bin/evas/dummy_slave.c
+++ b/src/bin/evas/dummy_slave.c
@@ -23,6 +23,10 @@ command_read(int fd, Slave_Command *cmd, void **params)
23 if (ret < (int)sizeof(int) * 2) 23 if (ret < (int)sizeof(int) * 2)
24 return EINA_FALSE; 24 return EINA_FALSE;
25 25
26 if(!((ints[0] > 0) && (ints[0] <= 0xFFFF) &&
27 (ints[1] >= 0) && (ints[1] < SLAVE_COMMAND_LAST)))
28 return EINA_FALSE;
29
26 size = ints[0]; 30 size = ints[0];
27 buf = malloc(size); 31 buf = malloc(size);
28 if (!buf) return EINA_FALSE; 32 if (!buf) return EINA_FALSE;