ublox: fix out-of-bounds array accesses

This patch fixes several invalid checks like this:

   array[i] && i < G_N_ELEMENTS (array)

which should instead be:

   i < G_N_ELEMENTS (array) && array[i]

to avoid an out-of-bounds access of the array.

Fixes: c1aa658802940327369a6a4cc50d35a4a6a9b04e
1 file changed