Language: Python
Label: safe
CWE: CWE-125 \u2014 Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.

Code:
  def testOutOfBoundsIndexRaisesInvalidArgument(self):
    with self.assertRaisesRegex(errors.InvalidArgumentError, "out of range"):
      indices = [[-1000], [405], [519], [758], [1015]]
      data = [
          [110.27793884277344],
          [120.29475402832031],
          [157.2418212890625],
          [157.2626953125],
          [188.45382690429688],
      ]

      self.evaluate(self.stitch_op(indices, data))