Page MenuHomePhabricator

eina_str: fix for escapable charachters not getting escaped if it comes after '\t' or '\n'

Authored by prasoonsingh16 on May 3 2017, 4:10 AM.



Escaping is not happening whenever any escapable characters is coming after
'\t' or '\n'. It will also fix invalid read of 1 byte which happens for string where
last charachter is '\t' or '\n' like "eina\t".

Test Plan

Take a string like "eina\t ". Observe space which is followed by tab is not getting

Signed-off-by: Prasoon Singh <>

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
prasoonsingh16 created this revision.May 3 2017, 4:10 AM
prasoonsingh16 added reviewers: cedric, shilpasingh, Unknown Object (User), Unknown Object (User).May 3 2017, 4:17 AM
cedric requested changes to this revision.May 8 2017, 3:16 PM

Could you provide additionnal test for detecting this problem ? This would avoid having it poping back in a few months, years, ...

This revision now requires changes to proceed.May 8 2017, 3:16 PM
prasoonsingh16 edited edge metadata.

Added test case based on review comment

shilpasingh accepted this revision.May 9 2017, 7:41 AM

Also fixes Invalid read

16673== Invalid read of size 1

16673== at 0x4E723C7: eina_str_escape (in /usr/local/efl-dev/lib/libeina.


16673== by 0x400EC9: main (in /home/prasoon.16/op_source/efl/src/examples


16673== Address 0x5db52e4 is 0 bytes after a block of size 4 alloc'd

16673== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-

16673== by 0x400EAF: main (in /home/prasoon.16/op_source/efl/src/examples



This revision was automatically updated to reflect the committed changes.