]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/coleitr.cpp
ICU-491.11.1.tar.gz
[apple/icu.git] / icuSources / i18n / coleitr.cpp
index 173166af622dc131b7f19372e2a035b15887f6df..7db3e5f752733a0df6dd47ec890e7a14261af6a9 100644 (file)
@@ -1,6 +1,6 @@
 /*
 *******************************************************************************
 /*
 *******************************************************************************
-* Copyright (C) 1996-2010, International Business Machines Corporation and    *
+* Copyright (C) 1996-2011, International Business Machines Corporation and    *
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */
 * others. All Rights Reserved.                                                *
 *******************************************************************************
 */
@@ -31,6 +31,7 @@
 #include "unicode/coleitr.h"
 #include "unicode/ustring.h"
 #include "ucol_imp.h"
 #include "unicode/coleitr.h"
 #include "unicode/ustring.h"
 #include "ucol_imp.h"
+#include "uassert.h"
 #include "cmemory.h"
 
 
 #include "cmemory.h"
 
 
@@ -418,7 +419,7 @@ const CollationElementIterator& CollationElementIterator::operator=(
         }
 
         /* start and end of string */
         }
 
         /* start and end of string */
-        coliter->endp = coliter->string + length;
+        coliter->endp = coliter->string == NULL ? NULL : coliter->string + length;
 
         /* handle writable buffer here */
 
 
         /* handle writable buffer here */
 
@@ -431,6 +432,7 @@ const CollationElementIterator& CollationElementIterator::operator=(
         if (othercoliter->pos >= othercoliter->string && 
             othercoliter->pos <= othercoliter->endp)
         {
         if (othercoliter->pos >= othercoliter->string && 
             othercoliter->pos <= othercoliter->endp)
         {
+            U_ASSERT(coliter->string != NULL);
             coliter->pos = coliter->string + 
                 (othercoliter->pos - othercoliter->string);
         }
             coliter->pos = coliter->string + 
                 (othercoliter->pos - othercoliter->string);
         }
@@ -462,6 +464,7 @@ const CollationElementIterator& CollationElementIterator::operator=(
         }
 
         if (othercoliter->fcdPosition != NULL) {
         }
 
         if (othercoliter->fcdPosition != NULL) {
+            U_ASSERT(coliter->string != NULL);
             coliter->fcdPosition = coliter->string + 
                 (othercoliter->fcdPosition 
                 - othercoliter->string);
             coliter->fcdPosition = coliter->string + 
                 (othercoliter->fcdPosition 
                 - othercoliter->string);