33 lines
887 B
Diff
33 lines
887 B
Diff
From 974ceb60c946b8b0183875131464335f91e9d6de Mon Sep 17 00:00:00 2001
|
|
From: Denis Kenzior <denkenz@gmail.com>
|
|
Date: Tue, 29 Sep 2020 16:09:31 -0500
|
|
Subject: dhcp: Allow DOMAIN_NAME options with trailing NULL
|
|
|
|
---
|
|
ell/dhcp-lease.c | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
diff --git a/ell/dhcp-lease.c b/ell/dhcp-lease.c
|
|
index e93c618..ac90c6a 100644
|
|
--- ell/dhcp-lease.c
|
|
+++ ell/dhcp-lease.c
|
|
@@ -111,6 +111,15 @@ struct l_dhcp_lease *_dhcp_lease_parse_options(struct dhcp_message_iter *iter)
|
|
if (memchr(v, 0, l - 1))
|
|
goto error;
|
|
|
|
+ /*
|
|
+ * RFC2132 doesn't say whether ending NULLs are present
|
|
+ * or not. However, section 2 recommends that trailing
|
|
+ * NULLs should not be used but must not be treated
|
|
+ * as an error
|
|
+ */
|
|
+ if (l_get_u8(v + l - 1) == 0)
|
|
+ l -= 1;
|
|
+
|
|
if (!l_utf8_validate(v, l, NULL))
|
|
goto error;
|
|
|
|
--
|
|
cgit 1.2.3-1.el7
|
|
|