diff --git a/src/if-options.c b/src/if-options.c index 9ac9f0b8..b55e65d6 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -2130,6 +2130,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, ndop->var = np; if (bp) { dl = strlen(bp); + if (dl > sizeof(ndop->bitflags)) { + logwarnx("bitflag string too long %s", bp); + dl = sizeof(ndop->bitflags); + } memcpy(ndop->bitflags, bp, dl); memset(ndop->bitflags + dl, 0, sizeof(ndop->bitflags) - dl);