Language: Java
Label: vulnerable
CWE: CWE-502 \u2014 Deserialization of Untrusted Data
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Code:
	public void addNullValue() {
		Version version = Version.getServerVersion(client, null);

		// Do not run on servers < 3.6.1
		if (version.isLess(3, 6, 1)) {
			return;
		}

		Key key = new Key(args.namespace, args.set, "addkey");
		String binName = "addbin";

		// Delete record if it already exists.
		client.delete(null, key);

		Bin bin = new Bin(binName, (Long)null);

		AerospikeException ae = assertThrows(AerospikeException.class, new ThrowingRunnable() {
			public void run() {
				client.add(null, key, bin);
			}
		});

		assertEquals(ae.getResultCode(), ResultCode.PARAMETER_ERROR);
	}