Skip to content

Commit

Permalink
privsep: fix strlcpy overflow in psp_ifname (#239)
Browse files Browse the repository at this point in the history
When running our Ubuntu tests with libc6 and strlcpy overflow checks
enabled we found that the wrong size is passed to strlcpy resulting
in a crash because of an overflow.
  • Loading branch information
tobhe committed Aug 15, 2023
1 parent f798bf2 commit 1bd8fc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/privsep.c
Expand Up @@ -1200,7 +1200,7 @@ ps_newprocess(struct dhcpcd_ctx *ctx, struct ps_id *psid)
#endif

if (!(ctx->options & DHCPCD_MANAGER))
strlcpy(psp->psp_ifname, ctx->ifv[0], sizeof(psp->psp_name));
strlcpy(psp->psp_ifname, ctx->ifv[0], sizeof(psp->psp_ifname));
TAILQ_INSERT_TAIL(&ctx->ps_processes, psp, next);
return psp;
}
Expand Down

0 comments on commit 1bd8fc7

Please sign in to comment.