1diff --git a/source/common/messagepattern.cpp b/source/common/messagepattern.cpp 2index 82cb638e..08474597 100644 3--- a/source/common/messagepattern.cpp 4+++ b/source/common/messagepattern.cpp 5@@ -437,7 +437,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength, 6 if(U_FAILURE(errorCode)) { 7 return 0; 8 } 9- if(nestingLevel>Part::MAX_VALUE) { 10+ if(nestingLevel>Part::MAX_NESTED_LEVELS) { 11 errorCode=U_INDEX_OUTOFBOUNDS_ERROR; 12 return 0; 13 } 14diff --git a/source/common/unicode/messagepattern.h b/source/common/unicode/messagepattern.h 15index 55b09bfb..daa7b623 100644 16--- a/source/common/unicode/messagepattern.h 17+++ b/source/common/unicode/messagepattern.h 18@@ -821,6 +821,7 @@ public: 19 20 static const int32_t MAX_LENGTH=0xffff; 21 static const int32_t MAX_VALUE=0x7fff; 22+ static const int32_t MAX_NESTED_LEVELS=0x03ff; 23 24 // Some fields are not final because they are modified during pattern parsing. 25 // After pattern parsing, the parts are effectively immutable. 26