partition_parser: Check to limit partition_count to NUM_ENTRIES.

Added condition to ensure that partition_entries, of size 32, always
uses index value(s) less than 32.

Change-Id: Ib2bcbd1cbecfb6afb486a7ec8e16694d069053e4
diff --git a/platform/msm_shared/partition_parser.c b/platform/msm_shared/partition_parser.c
index 68e54f1..45f5413 100644
--- a/platform/msm_shared/partition_parser.c
+++ b/platform/msm_shared/partition_parser.c
@@ -251,6 +251,7 @@
 
 	/* Read GPT Entries */
 	for (i = 0; i < (max_partition_count / 4); i++) {
+		ASSERT(partition_count < NUM_PARTITIONS);
 		ret = mmc_boot_read_from_card(mmc_host, mmc_card,
 					      (partition_0 * BLOCK_SIZE) +
 					      (i * BLOCK_SIZE),
@@ -800,6 +801,10 @@
 	unsigned int input_string_length = strlen(name);
 	unsigned n;
 
+	if( partition_count >= NUM_PARTITIONS)
+	{
+		return INVALID_PTN;
+	}
 	for (n = 0; n < partition_count; n++) {
 		if (!memcmp
 		    (name, &partition_entries[n].name, input_string_length)