mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-09-21 09:44:58 +03:00
firewall-util: add an assert that we're not overwriting a buffer
Check for CID #1368267.
This commit is contained in:
@@ -76,8 +76,11 @@ static int entry_fill_basics(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (out_interface) {
|
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);
|
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) {
|
if (destination) {
|
||||||
entry->ip.dst = destination->in;
|
entry->ip.dst = destination->in;
|
||||||
|
Reference in New Issue
Block a user