Page MenuHomePhabricator

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

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

Details

Summary

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
escaped.

Signed-off-by: Prasoon Singh <prasoon.16@samsung.com>

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
prasoonsingh16 created this revision.May 3 2017, 4:10 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.

so.1.19.99)

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

/eina/eina_str_01)

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

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

amd64-linux.so)

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

/eina/eina_str_01)

16673

This revision was automatically updated to reflect the committed changes.