openssd: check for out-of-bound index access