[haiku-commits] Change in haiku[master]: libroot/add-ons/icu: Fix V595

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 5 Feb 2020 10:23:04 +0000

From Murai Takashi <tmurai01@xxxxxxxxx>:

Murai Takashi has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2203 ;)


Change subject: libroot/add-ons/icu: Fix V595
......................................................................

libroot/add-ons/icu: Fix V595

Check 'in' pointer against NULL before using it.

Change-Id: I4d7605df168b6e4f8a2ae61ff942ce1a8ba78321
---
M src/system/libroot/add-ons/icu/ICUCollateData.cpp
1 file changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/03/2203/1

diff --git a/src/system/libroot/add-ons/icu/ICUCollateData.cpp 
b/src/system/libroot/add-ons/icu/ICUCollateData.cpp
index d300b45..b949db2 100644
--- a/src/system/libroot/add-ons/icu/ICUCollateData.cpp
+++ b/src/system/libroot/add-ons/icu/ICUCollateData.cpp
@@ -113,6 +113,11 @@
 status_t
 ICUCollateData::Strxfrm(char* out, const char* in, size_t size, size_t& 
outSize)
 {
+       if (in == NULL) {
+               outSize = 0;
+               return B_OK;
+       }
+
        if (fCollator == NULL || strcmp(fPosixLocaleName, "POSIX") == 0) {
                // handle POSIX here as the collator ICU uses for that 
(english) is
                // incompatible in too many ways
@@ -124,11 +129,6 @@
                return B_OK;
        }

-       if (in == NULL) {
-               outSize = 0;
-               return B_OK;
-       }
-
        UnicodeString unicodeIn;
        if (_ToUnicodeString(in, unicodeIn) != B_OK)
                return B_BAD_VALUE;

--
To view, visit https://review.haiku-os.org/c/haiku/+/2203
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I4d7605df168b6e4f8a2ae61ff942ce1a8ba78321
Gerrit-Change-Number: 2203
Gerrit-PatchSet: 1
Gerrit-Owner: Murai Takashi <tmurai01@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: libroot/add-ons/icu: Fix V595 - Gerrit