]> granicus.if.org Git - icu/commitdiff
ICU-9481 handled segmentation fault issue with uenum_next
authorDebabrata Sengupta <dsengup@svn.icu-project.org>
Mon, 27 Aug 2012 18:50:29 +0000 (18:50 +0000)
committerDebabrata Sengupta <dsengup@svn.icu-project.org>
Mon, 27 Aug 2012 18:50:29 +0000 (18:50 +0000)
X-SVN-Rev: 32242

icu4c/source/common/uenum.c

index 549769c449df2758248dd0ec2c428b01d21309fa..9a3d9e14148d7cee0d94d70c547c4cb660909117 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2002-2004, International Business Machines
+*   Copyright (C) 2002-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -160,7 +160,13 @@ uenum_next(UEnumeration* en,
         return NULL;
     }
     if (en->next != NULL) {
-        return en->next(en, resultLength, status);
+        if (resultLength != NULL) {
+            return en->next(en, resultLength, status);
+        }
+        else {
+            int32_t dummyLength=0;
+            return en->next(en, &dummyLength, status);
+        }
     } else {
         *status = U_UNSUPPORTED_ERROR;
         return NULL;