From f9000f256a77363a3b43b51a1afbb0b19faca101 Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 20 Jul 2023 11:10:03 +0000 Subject: [PATCH] Use sizeof(destination) not sizeof(source) in strlcpy() calls. OK tb@ --- usr.sbin/bgpd/control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c index fc516b8fd75..585d5f4fb12 100644 --- a/usr.sbin/bgpd/control.c +++ b/usr.sbin/bgpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.110 2023/04/20 12:53:27 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.111 2023/07/20 11:10:03 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -393,14 +393,14 @@ control_dispatch_msg(struct pollfd *pfd, struct peer_head *peers) p->conf.down = 1; strlcpy(p->conf.reason, neighbor->reason, - sizeof(neighbor->reason)); + sizeof(p->conf.reason)); session_stop(p, ERR_CEASE_ADMIN_DOWN); control_result(c, CTL_RES_OK); break; case IMSG_CTL_NEIGHBOR_CLEAR: strlcpy(p->conf.reason, neighbor->reason, - sizeof(neighbor->reason)); + sizeof(p->conf.reason)); p->IdleHoldTime = INTERVAL_IDLE_HOLD_INITIAL; p->errcnt = 0; -- 2.20.1