Skip to content

Commit

Permalink
Remove unneccessary id == NULL check after dereferencing it. id can n…
Browse files Browse the repository at this point in the history
…ever

be NULL here.

Found by tb@
  • Loading branch information
tobhe committed Sep 4, 2023
1 parent fefe9f9 commit 0dd6a1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions iked/ca.c
Original file line number Diff line number Diff line change
@@ -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) 2020-2021 Tobias Heider <tobhe@openbsd.org>
Expand Down Expand Up @@ -227,8 +227,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)
Expand Down

0 comments on commit 0dd6a1a

Please sign in to comment.