diff options
author | Isamu Mogi <saturday6c@gmail.com> | 2013-05-06 11:16:10 +0000 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-05-23 17:11:33 +0200 |
commit | e733777969b090ba9b81f0fa507d34487b23f150 (patch) | |
tree | f078b1d973d737091639c47f8acaf03a6cfbdaf1 /icu | |
parent | 4f7c23741e18a88c2da0c615558e2a1d406fed31 (diff) |
fdo#59850: Resolves invalid date changing by ICU's timezone detection bug.
This is a backport of 263ab3f14bbb8cea9f5a1b8ea7496f6a23e6c547 .
Patch was also submitted with https://ssl.icu-project.org/trac/ticket/10129
of which the outcome should be monitored.
u_strFromWCS() returns a wrong destination length for u_austrncpy() if
apiTZI.StandardName is multibyte string. Therefore apiStdName will be incomplete
string, and timezone detection (using apiStdName) returns invalid result. This
will fix destination length for u_austrncpy() enough to write multibyte string.
Change-Id: I0aa7da85aec41c61b04f76fb4cd5148f4d389991
Reviewed-on: https://gerrit.libreoffice.org/3798
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'icu')
-rw-r--r-- | icu/icu4c.10129.wintz.patch | 26 | ||||
-rw-r--r-- | icu/makefile.mk | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/icu/icu4c.10129.wintz.patch b/icu/icu4c.10129.wintz.patch new file mode 100644 index 000000000000..d365f5e669af --- /dev/null +++ b/icu/icu4c.10129.wintz.patch @@ -0,0 +1,26 @@ + +# Fix for fdo#59850 +# Patch was also submitted with https://ssl.icu-project.org/trac/ticket/10129 +# of which the outcome should be monitored. + +--- misc/icu/source/common/wintz.c 2012-04-05 20:46:14.000000000 +0000 ++++ misc/build/icu/source/common/wintz.c 2013-05-03 13:00:47.188384300 +0000 +@@ -255,7 +255,6 @@ + char apiStdName[MAX_LENGTH_ID]; + char regStdName[MAX_LENGTH_ID]; + char tmpid[MAX_LENGTH_ID]; +- int32_t apiStdLength = 0; + int32_t len; + + LONG result; +@@ -278,8 +277,8 @@ + + /* Convert the wchar_t* standard name to char* */ + uprv_memset(apiStdName, 0, sizeof(apiStdName)); +- u_strFromWCS(apiStd, MAX_LENGTH_ID, &apiStdLength, apiTZI.StandardName, -1, &status); +- u_austrncpy(apiStdName, apiStd, apiStdLength); ++ u_strFromWCS(apiStd, MAX_LENGTH_ID, NULL, apiTZI.StandardName, -1, &status); ++ u_austrncpy(apiStdName, apiStd, sizeof(apiStdName) - 1); + + tmpid[0] = 0; + diff --git a/icu/makefile.mk b/icu/makefile.mk index 98708df4fb39..1f6e8e8f5652 100644 --- a/icu/makefile.mk +++ b/icu/makefile.mk @@ -46,6 +46,7 @@ TARFILE_ROOTDIR=icu #http://bugs.icu-project.org/trac/ticket/8198 rendering with 0D30 and 0D31 PATCH_FILES=\ + icu4c.10129.wintz.patch \ icu4c.9948.mlym-crash.patch \ icu4c-bsd.patch \ icu4c-build.patch \ |