mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-24 04:30:41 +02:00
dhcp: fix nm_dhcp_lease_data_parse_cstr() to correctly detect NUL chars
Fixes: 784932550c ('dhcp/nettools: validate and normalize Host Name Option (12)')
This commit is contained in:
parent
0fb4ba5bef
commit
881b42c454
1 changed files with 1 additions and 1 deletions
|
|
@ -880,7 +880,7 @@ nm_dhcp_lease_data_parse_cstr(const guint8 *data, gsize n_data, gsize *out_new_l
|
|||
n_data--;
|
||||
|
||||
if (n_data > 0) {
|
||||
if (memchr(data, n_data, '\0')) {
|
||||
if (memchr(data, '\0', n_data)) {
|
||||
/* we accept trailing NUL, but none in between.
|
||||
*
|
||||
* https://tools.ietf.org/html/rfc2132#section-2
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue