fix(3p/nix): remove usage of strcpy

Change-Id: I86125609f433469a8722c780fd758234211d677e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1381
Tested-by: BuildkiteCI
Reviewed-by: Alyssa Ross <hi@alyssa.is>
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Kane York 2020-07-23 13:02:03 -07:00 committed by kanepyork
parent ec46a594df
commit 9a85694b86
4 changed files with 10 additions and 9 deletions

View file

@ -2833,7 +2833,7 @@ void DerivationGoal::runChild() {
}
struct ifreq ifr;
strcpy(ifr.ifr_name, "lo");
strncpy(ifr.ifr_name, "lo", sizeof("lo"));
ifr.ifr_flags = IFF_UP | IFF_LOOPBACK | IFF_RUNNING;
if (ioctl(fd.get(), SIOCSIFFLAGS, &ifr) == -1) {
throw SysError("cannot set loopback interface flags");