Commit graph

18 commits

Author SHA1 Message Date
Fredrik Roubert
0178a07a26 ICU-22793 Clang-Tidy: google-readability-casting
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/google/readability-casting.html
2024-07-04 22:32:12 +02:00
Fredrik Roubert
daa0171501 ICU-22608 Add necessary using statements for namespace icu. 2023-12-22 08:12:47 +09:00
Fredrik Roubert
2de88f9d9c ICU-21833 Replace UChar with char16_t in all C++ code. 2023-02-06 19:27:44 +01:00
Frank Tang
de0a28644b ICU-22251 Move sprintf to snprintf.
See #2291
2023-01-25 23:23:29 -08:00
Tobias Stoeckmann
7369eff4ed ICU-20362 segfault/leftover files with long lines
If a file with an input line larger than INT32_MAX (i.e. 2 GB) contains
an UTF8 character after that limit, escapesrc crashes on 64 bit systems
or does not remove incomplete files on 32 bit systems.

The issue is that an unchecked cast from size_t to int32_t can turn
negative, which results in negative offsets during array access.

This will eventually lead to an out of boundary read, which most likely
crashes the tool.

This patch sets a fixed limit on 1 GB to make sure that no side effects
occur if the line is exactly INT32_MAX or a few bytes less. It should
still be way more than anyone would really need.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-02-13 10:23:19 -08:00
Steven R. Loomis
965d758dd7 ICU-13083 update escaper per feedback, remerge r41105
X-SVN-Rev: 41106
2018-03-14 20:45:39 +00:00
Steven R. Loomis
a16ecdad92 ICU-13083 cleanup unescaper, use portable calls
X-SVN-Rev: 40853
2018-02-07 23:31:40 +00:00
Andy Heninger
0ce89095fe ICU-13173 Compile warning cleanup in escapesrc.cpp
X-SVN-Rev: 40078
2017-04-26 20:55:10 +00:00
Steven R. Loomis
b58e1721a1 ICU-12766 fix to escaper for z/OS - all compiles now!
X-SVN-Rev: 39936
2017-03-25 05:16:48 +00:00
Steven R. Loomis
e20856d499 ICU-12766 fix unescape on EBCDIC
* increment error
* need to do UTF-8 decode at the original location, not the modified one

X-SVN-Rev: 39935
2017-03-25 00:09:23 +00:00
Steven R. Loomis
02cf91d3e6 ICU-12766 support escaping on ebcdic (z)
X-SVN-Rev: 39842
2017-03-16 21:49:19 +00:00
Steven R. Loomis
a1afc24f8c ICU-12766 fix issue w/ u8 escaping
* greek tests now pass on solaris

X-SVN-Rev: 39835
2017-03-16 15:15:26 +00:00
Steven R. Loomis
14f45141ba ICU-12766 fix buffer size
X-SVN-Rev: 39831
2017-03-15 23:48:54 +00:00
Steven R. Loomis
b9ecfe69c3 ICU-12766 aix/escaper: WIP. Support u8
* support u8
* main tools now builds on AIX
* remove c'tors seen as duplicate under AIX
* successful build under AIX

X-SVN-Rev: 39818
2017-03-15 16:58:45 +00:00
Steven R. Loomis
394e842e60 ICU-12766 aix/escaper: WIP.
* work around some c++11 issues
* fix some literals in rbbitst.cpp
* update escaper
* add mh-aix-va for using escaping
* work around nullptr and uchar16 issues
* revert bad icuinfo.cpp checkin

this commit still fails.

X-SVN-Rev: 39812
2017-03-15 04:12:37 +00:00
Steven R. Loomis
383d3eead1 ICU-12766 cleanup and add test case for escaper
X-SVN-Rev: 39810
2017-03-15 02:16:35 +00:00
Steven R. Loomis
4890638e08 ICU-12766 wip escaping for utf-8 input
* create a new escaper tool - needs to be invoked in mh- files
* escapes to temporary _whatever.cpp files
* does NOT handle multi line u"xxx" (or u'xxx'? )
* does not cleanup _*.cpp files
* fixup a bunch of Makefiles to add -I$(srcdir) (doesn't hurt anyway)

X-SVN-Rev: 39787
2017-03-13 23:19:33 +00:00
Steven R. Loomis
d9cdb7568c ICU-12766 add stub escapesrc
X-SVN-Rev: 39774
2017-03-13 19:08:18 +00:00