firewall-util: add an assert that we're not overwriting a buffer
... like commit f28501279d
does for
out_interface.
This commit is contained in:
parent
e99742ef3e
commit
0b777d20e9
|
@ -50,8 +50,14 @@ static int entry_fill_basics(
|
||||||
entry->ip.proto = protocol;
|
entry->ip.proto = protocol;
|
||||||
|
|
||||||
if (in_interface) {
|
if (in_interface) {
|
||||||
|
size_t l;
|
||||||
|
|
||||||
|
l = strlen(in_interface);
|
||||||
|
assert(l < sizeof entry->ip.iniface);
|
||||||
|
assert(l < sizeof entry->ip.iniface_mask);
|
||||||
|
|
||||||
strcpy(entry->ip.iniface, in_interface);
|
strcpy(entry->ip.iniface, in_interface);
|
||||||
memset(entry->ip.iniface_mask, 0xFF, strlen(in_interface)+1);
|
memset(entry->ip.iniface_mask, 0xFF, l + 1);
|
||||||
}
|
}
|
||||||
if (source) {
|
if (source) {
|
||||||
entry->ip.src = source->in;
|
entry->ip.src = source->in;
|
||||||
|
|
Loading…
Reference in New Issue