From fb8311e48f5ee4a4d11299ee7aadabca581eb1da Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Mon, 17 Jun 2024 20:47:24 +0000 Subject: replace asserts with error returns --- proxy-proto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'proxy-proto.c') diff --git a/proxy-proto.c b/proxy-proto.c index 9dc1457..bef2633 100644 --- a/proxy-proto.c +++ b/proxy-proto.c @@ -159,15 +159,16 @@ proxy_proto_v1_parse(struct proxy_protocol_v1 *s, char *buf, size_t buflen, return (-1); break; - default: - ASSERT_MSG(0, "unimplemented"); + default: + return (-1); } if (check_port_v1(&s->srcport, &buf, &buflen) == -1 || check_port_v1(&s->dstport, &buf, &buflen) == -1) return (-1); - assert('\n' == *buf); + if (*buf != '\n') + return (-1); buf += 1; *consumed = buf - begin; -- cgit v1.2.3