Skip to content

Commit 9cbfc68

Browse files
committed
main: fix an Out-of-bounds access
Coverity: CID 739670 (#1 of 1): Out-of-bounds access (OVERRUN) At (46): Overrunning struct type in_addr of 4 bytes by passing it to a function which accesses it at byte offset 15 using argument "16UL". Signed-off-by: Ferry Huberts <[email protected]>
1 parent 23ba322 commit 9cbfc68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,8 @@ static int olsr_process_arguments(int argc, char *argv[],
11371137

11381138
ifa->cnf = get_default_if_config();
11391139
ifa->host_emul = true;
1140-
memcpy(&ifa->hemu_ip, &in, sizeof(union olsr_ip_addr));
1140+
memset(&ifa->hemu_ip, 0, sizeof(ifa->hemu_ip));
1141+
memcpy(&ifa->hemu_ip, &in, sizeof(in));
11411142
cnf->host_emul = true;
11421143

11431144
continue;

0 commit comments

Comments
 (0)