rnp
rnp copied to clipboard
Coverity CID 1428747: Memory - illegal accesses (USE_AFTER_FREE)
** CID 1428747: Memory - illegal accesses (USE_AFTER_FREE)
/src/tests/ffi.cpp: 8334 in rnp_tests_test_ffi_export_revocation_Test::TestBody()()
________________________________________________________________________________________________________
*** CID 1428747: Memory - illegal accesses (USE_AFTER_FREE)
/src/tests/ffi.cpp: 8334 in rnp_tests_test_ffi_export_revocation_Test::TestBody()()
8328 assert_rnp_success(rnp_key_export_revocation(key_handle, output, 0, "SHA256", NULL, NULL));
8329 assert_rnp_success(rnp_output_destroy(output));
8330 assert_rnp_success(rnp_output_to_path(&output, "alice-revocation.pgp"));
8331 /* correct password provider - must succeed */
8332 assert_rnp_success(rnp_key_lock(key_handle));
8333 assert_rnp_success(rnp_ffi_set_pass_provider(ffi, getpasscb, (void *) "password"));
CID 1428747: Memory - illegal accesses (USE_AFTER_FREE)
Passing freed pointer "output" as an argument to "rnp_key_export_revocation".
8334 assert_rnp_success(rnp_key_export_revocation(
8335 key_handle, output, 0, "SHA256", "superseded", "test key revocation"));
8336 /* make sure FFI locks key back */
8337 bool locked = false;
8338 assert_rnp_success(rnp_key_is_locked(key_handle, &locked));
8339 assert_true(locked);
This is actually about tests, we have a lot of issues like this. What about totally disabling analysis for tests folder? CC @ronaldtse @dewyatt
While tests sources are marked as ignored for a while, Coverity still seem to analyze those and include into overall density calculations. Not sure what else could be done to display shiny green badge.

