From: tobhe Date: Sat, 2 Sep 2023 18:16:02 +0000 (+0000) Subject: Remove unneccessary id == NULL check after dereferencing it. id can never X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f357fd059827b5a2e88ea0c11e097603771dc5f6;p=openbsd Remove unneccessary id == NULL check after dereferencing it. id can never be NULL here. Found by tb@ --- 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)