examples/fips_validation: fix crash on allocation failure
authorCiara Power <ciara.power@intel.com>
Fri, 30 Oct 2020 15:37:00 +0000 (15:37 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Sat, 31 Oct 2020 17:00:03 +0000 (18:00 +0100)
commitafda6b01164dc83f71a684b94c0c9d096281caad
tree81f21b7ff98e6ac87d19c38f65231967a6113183
parent5284adad3e95025f9901869f581c8c04ea642d32
examples/fips_validation: fix crash on allocation failure

The return value was not being checked when calling the
get_writeback_data function in the AES test case. On failure, this led
to a NULL dereference when using memcpy later. The return value is now
checked to avoid this NULL dereference.

Coverity issue: 363463
Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
examples/fips_validation/main.c