summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-24 14:50:27 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-10-24 14:52:16 +0200
commit408102427f872113f4da34a11172efd4bf8c7f72 (patch)
tree305479d23852c6301672613ed8a6bd6c24e0c2f7
parentfbb8d8337392f8eb23bf1968b95b8116a2b3cf43 (diff)
examples/efl_thread: fix oob writes
Summary: CIDs 1403896, 1403895, 1403892 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10395
-rw-r--r--src/examples/ecore/efl_thread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/examples/ecore/efl_thread.c b/src/examples/ecore/efl_thread.c
index 301bf5c06d..5a2ce1411a 100644
--- a/src/examples/ecore/efl_thread.c
+++ b/src/examples/ecore/efl_thread.c
@@ -35,7 +35,7 @@ _th_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
35 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 35 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
36 if (!err) 36 if (!err)
37 { 37 {
38 buf[rw_slice.len] = 0; 38 buf[rw_slice.len - 1] = 0;
39 printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 39 printf("--- TH READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
40 40
41 char *buf2 = "yes-im-here "; 41 char *buf2 = "yes-im-here ";
@@ -112,7 +112,7 @@ _read_change(void *data EINA_UNUSED, const Efl_Event *ev)
112 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 112 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
113 if (!err) 113 if (!err)
114 { 114 {
115 buf[rw_slice.len] = 0; 115 buf[rw_slice.len - 1] = 0;
116 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 116 printf("--- READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
117 } 117 }
118 } 118 }
@@ -146,7 +146,7 @@ _stdin_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
146 Eina_Error err = efl_io_reader_read(obj, &rw_slice); 146 Eina_Error err = efl_io_reader_read(obj, &rw_slice);
147 if (!err) 147 if (!err)
148 { 148 {
149 buf[rw_slice.len] = 0; 149 buf[rw_slice.len - 1] = 0;
150 printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf); 150 printf("--- STDIN READ [%p] [%s] ok %i bytes '%s'\n", obj, efl_core_command_line_command_get(obj), (int)rw_slice.len, buf);
151 } 151 }
152 } 152 }