coverity#1242708 Untrusted loop bound

Change-Id: Ic5af417ad38cafa46051789574239996a8845ffb