summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-24 23:32:42 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-25 13:21:25 +0100
commitb3c5008284d5002bd7e5a78968498996d6154569 (patch)
treea5a2caf37bb08846df4debf8b1609bfa74162c81
parente9adfbae00e1907d9c080e1cdd34644670ba537c (diff)
exactness - injecotr - alloc correct buffer size
didn't account for null bytes... fix.
-rw-r--r--src/bin/exactness/injector.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/exactness/injector.c b/src/bin/exactness/injector.c
index 1482414740..183a5112eb 100644
--- a/src/bin/exactness/injector.c
+++ b/src/bin/exactness/injector.c
@@ -150,7 +150,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
150 case EXACTNESS_ACTION_KEY_UP: 150 case EXACTNESS_ACTION_KEY_UP:
151 { 151 {
152 Exactness_Action_Key_Down_Up *t = data; 152 Exactness_Action_Key_Down_Up *t = data;
153 int len = 2*sizeof(int) + 4; 153 int len = 2*sizeof(int) + 4 + 1;
154 len += t->keyname ? strlen(t->keyname) : 0; 154 len += t->keyname ? strlen(t->keyname) : 0;
155 len += t->key ? strlen(t->key) : 0; 155 len += t->key ? strlen(t->key) : 0;
156 len += t->string ? strlen(t->string) : 0; 156 len += t->string ? strlen(t->string) : 0;
@@ -180,7 +180,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
180 case EXACTNESS_ACTION_EFL_EVENT: 180 case EXACTNESS_ACTION_EFL_EVENT:
181 { 181 {
182 Exactness_Action_Efl_Event *t = data; 182 Exactness_Action_Efl_Event *t = data;
183 int len = 0; 183 int len = 2;
184 len += t->wdg_name ? strlen(t->wdg_name) : 0; 184 len += t->wdg_name ? strlen(t->wdg_name) : 0;
185 len += t->event_name ? strlen(t->event_name) : 0; 185 len += t->event_name ? strlen(t->event_name) : 0;
186 char *buf = malloc(len), *tmp = buf; 186 char *buf = malloc(len), *tmp = buf;
@@ -194,7 +194,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data)
194 case EXACTNESS_ACTION_CLICK_ON: 194 case EXACTNESS_ACTION_CLICK_ON:
195 { 195 {
196 Exactness_Action_Click_On *t = data; 196 Exactness_Action_Click_On *t = data;
197 int len = 0; 197 int len = 1;
198 len += t->wdg_name ? strlen(t->wdg_name) : 0; 198 len += t->wdg_name ? strlen(t->wdg_name) : 0;
199 char *buf = malloc(len), *tmp = buf; 199 char *buf = malloc(len), *tmp = buf;
200 DBG("%s %s\n", __func__, "Click On"); 200 DBG("%s %s\n", __func__, "Click On");