-/* $OpenBSD: control.c,v 1.111 2023/07/20 11:10:03 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.112 2023/08/04 09:20:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
if (imsg.hdr.len == IMSG_HEADER_SIZE +
sizeof(struct ctl_neighbor)) {
neighbor = imsg.data;
- neighbor->descr[PEER_DESCR_LEN - 1] = 0;
} else {
neighbor = NULL;
}
}
neighbor = imsg.data;
- neighbor->descr[PEER_DESCR_LEN - 1] = 0;
matched = 0;
RB_FOREACH(p, peer_head, peers) {
ribreq = imsg.data;
neighbor = &ribreq->neighbor;
- neighbor->descr[PEER_DESCR_LEN - 1] = 0;
/* check if at least one neighbor exists */
RB_FOREACH(p, peer_head, peers)
-/* $OpenBSD: rde.c,v 1.608 2023/07/12 14:45:42 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.609 2023/08/04 09:20:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
return 0;
} else if (n && n->descr[0]) {
s = n->is_group ? p->conf.group : p->conf.descr;
- if (strcmp(s, n->descr))
+ /* cannot trust n->descr to be properly terminated */
+ if (strncmp(s, n->descr, sizeof(n->descr)))
return 0;
}
return 1;
-/* $OpenBSD: session.c,v 1.446 2023/07/12 14:45:43 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.447 2023/08/04 09:20:12 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
return 0;
} else if (n && n->descr[0]) {
s = n->is_group ? p->conf.group : p->conf.descr;
- if (strcmp(s, n->descr))
+ /* cannot trust n->descr to be properly terminated */
+ if (strncmp(s, n->descr, sizeof(n->descr)))
return 0;
}
return 1;