From: Hokwon Song Date: Fri, 5 Apr 2013 02:24:08 +0000 (+0900) Subject: Fix dereferencing null pointer X-Git-Tag: accepted/tizen_2.1/20130425.034849~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc93158e275849113c4bfe9fac161f39d0bea9da;p=platform%2Fframework%2Fnative%2Fappfw.git Fix dereferencing null pointer Change-Id: I397ec6549590d1d4943417356577e8b03ea1d292 Signed-off-by: Hokwon Song --- diff --git a/src/text/FText_GsmEncodingCore.cpp b/src/text/FText_GsmEncodingCore.cpp index 7805c16..fb2ebda 100644 --- a/src/text/FText_GsmEncodingCore.cpp +++ b/src/text/FText_GsmEncodingCore.cpp @@ -290,7 +290,7 @@ wchar_t* _GsmEncodingCore::DecodeN(const byte* pSrc, int srcLength, int& retLength) { // 0 in GSM is mapped to 0x40 ['@'] in UNICODE, following code is to handle terminating null. - if (srcLength > 1 && pSrc && pSrc[srcLength - 1] == '\0') + if (srcLength > 1 && pSrc[srcLength - 1] == '\0') { --srcLength; } @@ -304,7 +304,7 @@ _GsmEncodingCore::DecodeN(const byte* pSrc, int srcLength, int& retLength) byte* pGsmByte = (byte*) pSrc; wchar_t* pCurrPos = pDst.get(); int index = 0; - while (srcLength > 0) + while (srcLength > 0 && pGsmByte != null) { *pCurrPos = GSM_UNICODE_TABLE[*pGsmByte]; if (*pGsmByte == 0x001B)