mirror of
https://github.com/NetworkConfiguration/dhcpcd.git
synced 2026-01-26 14:13:26 +00:00
options: Ensure that an overly long bitflag string does not crash
Fixes #573.
This commit is contained in:
parent
63bfc6d296
commit
e92ba41e9b
@ -2130,6 +2130,10 @@ err_sla:
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user