Commit 266a0ed4 authored by Andre Przywara's avatar Andre Przywara Committed by Will Deacon
Browse files

builtin-run: Replace strncpy calls with strlcpy



There are two uses of strncpy in builtin-run.c, where we don't make
proper use of strncpy, so that GCC 8.x complains and aborts compilation.

Replace those two calls with strlcpy(), which does the right thing in
our case.
Signed-off-by: Andre Przywara's avatarAndre Przywara <andre.przywara@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 5eb1f27a
......@@ -300,7 +300,7 @@ static const char *find_kernel(void)
k++;
continue;
}
strncpy(kernel, *k, PATH_MAX);
strlcpy(kernel, *k, PATH_MAX);
return kernel;
}
......@@ -418,7 +418,7 @@ static void resolve_program(const char *src, char *dst, size_t len)
die("Pathname too long: %s -> %s\n", src, resolved_path);
} else
strncpy(dst, src, len);
strlcpy(dst, src, len);
}
static void kvm_run_write_sandbox_cmd(struct kvm *kvm, const char **argv, int argc)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment