commit | c269da78697e18af4d11659931d010f6de2dbc85 | [log] [tgz] |
---|---|---|
author | Stefan Berger <stefanb@linux.ibm.com> | Wed May 25 15:34:57 2022 -0400 |
committer | Stefan Berger <stefanb@us.ibm.com> | Wed May 25 18:54:58 2022 -0400 |
tree | 9ad48f714acc17f27f948b0e2c7a012428a64166 | |
parent | 42d5f3b50fb29b0c7033c65fd6d3892bfcedadb2 [diff] |
swtpm_cert: Test for NULL pointer returned by malloc Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
diff --git a/src/swtpm_cert/ek-cert.c b/src/swtpm_cert/ek-cert.c index b66e1a4..eec5c70 100644 --- a/src/swtpm_cert/ek-cert.c +++ b/src/swtpm_cert/ek-cert.c
@@ -197,6 +197,10 @@ } result = malloc(len / 2); + if (result == NULL) { + fprintf(stderr, "Out of memory tring to allocated %d bytes.", len / 2); + return NULL; + } i = 0; j = 0;