mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-04 22:20:40 +01: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)') (cherry picked from commit881b42c454)
This commit is contained in:
parent
03914cbf2d
commit
0b8cf38b68
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