diff options
author | 2018-09-18 13:55:28 +0000 | |
---|---|---|
committer | 2018-09-18 13:55:28 +0000 | |
commit | 3f41b616a513af6c3ccd5d9a008d6ab30468d7e6 (patch) | |
tree | 74f916a74b3117466ab1e73381712ffae262fd16 | |
parent | Increase minimum size for /usr/obj partition to 5 Gig. This allows (diff) | |
download | wireguard-openbsd-3f41b616a513af6c3ccd5d9a008d6ab30468d7e6.tar.xz wireguard-openbsd-3f41b616a513af6c3ccd5d9a008d6ab30468d7e6.zip |
fix a crash when prefix length is not specified
-rw-r--r-- | regress/usr.sbin/bgpd/unittests/rde_trie_test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/regress/usr.sbin/bgpd/unittests/rde_trie_test.c b/regress/usr.sbin/bgpd/unittests/rde_trie_test.c index 5b5bc368687..623441f6068 100644 --- a/regress/usr.sbin/bgpd/unittests/rde_trie_test.c +++ b/regress/usr.sbin/bgpd/unittests/rde_trie_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_trie_test.c,v 1.3 2018/09/10 20:51:59 benno Exp $ */ +/* $OpenBSD: rde_trie_test.c,v 1.4 2018/09/18 13:55:28 denis Exp $ */ /* * Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org> @@ -76,10 +76,12 @@ host_v6(const char *s, struct bgpd_addr *h, u_int8_t *len, int *orl) memcpy(&h->v6, &res->ai_addr->sa_data[6], sizeof(h->v6)); freeaddrinfo(res); *len = mask; - *p = '/'; + if (p) + *p = '/'; return (1); } - *p = '/'; + if (p) + *p = '/'; return (0); } |