From 176e02226a120ca72ea7e1b8914adf6860be7476 Mon Sep 17 00:00:00 2001 From: tobhe Date: Fri, 19 Nov 2021 21:16:25 +0000 Subject: [PATCH] Check stdrup() return value. --- sbin/iked/ocsp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbin/iked/ocsp.c b/sbin/iked/ocsp.c index 6c8898aa199..06d77af3996 100644 --- a/sbin/iked/ocsp.c +++ b/sbin/iked/ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.c,v 1.21 2020/12/22 21:01:55 tobhe Exp $ */ +/* $OpenBSD: ocsp.c,v 1.22 2021/11/19 21:16:25 tobhe Exp $ */ /* * Copyright (c) 2014 Markus Friedl @@ -149,6 +149,10 @@ ocsp_connect(struct iked *env, struct imsg *imsg) oc->oc_sh = sh; oc->oc_path = path; oc->oc_url = strdup(url); + if (oc->oc_url == NULL) { + log_warn("%s: strdup failed", SPI_SH(&sh, __func__)); + goto done; + } path = NULL; log_debug("%s: connect(%s, %s)", __func__, host, port); -- 2.20.1