sdm: Fix out of bounds access

Fix out of bounds access caused by wrong indexing by a reverse
for-loop. This fixes the issue of random value changes in some
heap variables.

CRs-fixed: 970632
Change-Id: I558468d59f577bca3db5fb094cdb3b11270ec35b
1 file changed