From f357fd059827b5a2e88ea0c11e097603771dc5f6 Mon Sep 17 00:00:00 2001 From: tobhe Date: Sat, 2 Sep 2023 18:16:02 +0000 Subject: [PATCH] Remove unneccessary id == NULL check after dereferencing it. id can never be NULL here. Found by tb@ --- sbin/iked/ca.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sbin/iked/ca.c b/sbin/iked/ca.c index ee8dbacc69c..424bd997cd9 100644 --- a/sbin/iked/ca.c +++ b/sbin/iked/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.96 2023/08/04 19:06:25 claudio Exp $ */ +/* $OpenBSD: ca.c,v 1.97 2023/09/02 18:16:02 tobhe Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -210,8 +210,7 @@ ca_certbundle_add(struct ibuf *buf, struct iked_id *id) size_t len = ibuf_size(id->id_buf); void *val = ibuf_data(id->id_buf); - if (id == NULL || - buf == NULL || + if (buf == NULL || ibuf_add(buf, &type, sizeof(type)) != 0 || ibuf_add(buf, &len, sizeof(len)) != 0 || ibuf_add(buf, val, len) != 0) -- 2.20.1