summaryrefslogtreecommitdiff
path: root/usr/src/lib/libelfsign
diff options
context:
space:
mode:
authorjohnz <none@none>2008-02-06 13:17:12 -0800
committerjohnz <none@none>2008-02-06 13:17:12 -0800
commit3b0164d5a9177d3e9e05e26ac275cc5bac564ed1 (patch)
tree776eda223fa31dfc5a1f881732d2cc2de764b497 /usr/src/lib/libelfsign
parentee1dce25985fde428f95a05de8bd28e179382974 (diff)
downloadillumos-joyent-3b0164d5a9177d3e9e05e26ac275cc5bac564ed1.tar.gz
6649721 elfsign sign/verify with missing certificate can dump core
Diffstat (limited to 'usr/src/lib/libelfsign')
-rw-r--r--usr/src/lib/libelfsign/common/elfsignlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr/src/lib/libelfsign/common/elfsignlib.c b/usr/src/lib/libelfsign/common/elfsignlib.c
index 00f71a125d..d40a8bd0e9 100644
--- a/usr/src/lib/libelfsign/common/elfsignlib.c
+++ b/usr/src/lib/libelfsign/common/elfsignlib.c
@@ -426,11 +426,11 @@ elfsign_setcertpath(ELFsign_t ess, const char *certpath)
* doing it to help provide early failure and better error
* checking, so there is no race condition.
*/
- if (access(certpath, R_OK) != 0) {
- elfsign_end(ess);
+ if (access(certpath, R_OK) != 0)
return (ELFSIGN_INVALID_CERTPATH);
- }
- ess->es_certpath = strdup(certpath);
+
+ if ((ess->es_certpath = strdup(certpath)) == NULL)
+ return (ELFSIGN_FAILED);
if (ES_ACTISUPDATE(ess->es_action)) {
ELFCert_t cert = NULL;