common: Fix wrong index calculation for pointers array

There was a possibilty of too big index usage.
it was reported by 'warning: array subscript is above array bounds'