mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
firewall-util: add an assert that we're not overwriting a buffer
Check for CID #1368267.
This commit is contained in:
parent
1e94df4471
commit
f28501279d
@ -76,8 +76,11 @@ static int entry_fill_basics(
|
||||
}
|
||||
|
||||
if (out_interface) {
|
||||
size_t l = strlen(out_interface);
|
||||
assert(l < sizeof entry->ip.outiface && l < sizeof entry->ip.outiface_mask);
|
||||
|
||||
strcpy(entry->ip.outiface, out_interface);
|
||||
memset(entry->ip.outiface_mask, 0xFF, strlen(out_interface)+1);
|
||||
memset(entry->ip.outiface_mask, 0xFF, l + 1);
|
||||
}
|
||||
if (destination) {
|
||||
entry->ip.dst = destination->in;
|
||||
|
Loading…
Reference in New Issue
Block a user