feat(tests): Decoding of JSON (we encoded) must succeed in fuzzing

This commit is contained in:
Julius Pfrommer
2022-02-15 11:30:43 +01:00
committed by Julius Pfrommer
parent 13c94be60a
commit 9a1663bdb7
+1 -6
View File
@@ -38,12 +38,7 @@ LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
UA_Variant value2;
UA_Variant_init(&value2);
retval = UA_decodeJson(&buf2, &value2, &UA_TYPES[UA_TYPES_VARIANT], NULL);
if(retval != UA_STATUSCODE_GOOD) {
UA_Variant_clear(&value);
UA_ByteString_clear(&buf2);
return 0;
}
UA_assert(retval == UA_STATUSCODE_GOOD);
UA_assert(UA_order(&value, &value2, &UA_TYPES[UA_TYPES_VARIANT]) == UA_ORDER_EQ);
UA_Variant_clear(&value);