diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-08-01 13:36:36 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-08-01 13:36:36 +0200 |
| commit | 02cf149ed71b17326bdca69fcae8224d043fc7bb (patch) | |
| tree | d65da719796803588b19decc1cd3d87f50cb98e1 /networking | |
| parent | 48ec979ed1b3eb1441363240915ef0b9a91c545d (diff) | |
| download | busybox-w32-02cf149ed71b17326bdca69fcae8224d043fc7bb.tar.gz busybox-w32-02cf149ed71b17326bdca69fcae8224d043fc7bb.tar.bz2 busybox-w32-02cf149ed71b17326bdca69fcae8224d043fc7bb.zip | |
udhcpc: add a cooment about sanitizing DHCP_DOMAIN_NAME, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
| -rw-r--r-- | networking/udhcp/dhcpc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 3afdb35fe..0310663e0 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
| @@ -274,6 +274,12 @@ static NOINLINE char *xmalloc_optname_optval(uint8_t *option, const struct dhcp_ | |||
| 274 | case OPTION_STRING_HOST: | 274 | case OPTION_STRING_HOST: |
| 275 | memcpy(dest, option, len); | 275 | memcpy(dest, option, len); |
| 276 | dest[len] = '\0'; | 276 | dest[len] = '\0'; |
| 277 | //TODO: it appears option 15 DHCP_DOMAIN_NAME is often abused | ||
| 278 | //by DHCP admins to contain a space-separated list of domains, | ||
| 279 | //not one domain name (presumably, to work as list of search domains, | ||
| 280 | //instead of using proper option 119 DHCP_DOMAIN_SEARCH). | ||
| 281 | //Currently, good_hostname() balks on strings containing spaces. | ||
| 282 | //Do we need to allow it? Only for DHCP_DOMAIN_NAME option? | ||
| 277 | if (type == OPTION_STRING_HOST && !good_hostname(dest)) | 283 | if (type == OPTION_STRING_HOST && !good_hostname(dest)) |
| 278 | safe_strncpy(dest, "bad", len); | 284 | safe_strncpy(dest, "bad", len); |
| 279 | return ret; | 285 | return ret; |
