Language: Python
Label: safe
CWE: CWE-476 \u2014 NULL Pointer Dereference
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.

Code:
  def testImportShapeInference(self, is_anonymous):
    v = variables.Variable(1)

    @def_function.function(jit_compile=True)
    def foo():
      return gen_lookup_ops.lookup_table_import_v2(
          table_handle=v.handle, keys=[1.1, 2.2], values=1
      )

    with self.assertRaisesRegex(
        ValueError, r"Shape must be at least rank 1 but is rank 0"
    ):
      foo()