summaryrefslogtreecommitdiffstats
path: root/sys/kgssapi/gss_impl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kgssapi/gss_impl.c')
-rw-r--r--sys/kgssapi/gss_impl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c
index d27f219..2c5922e 100644
--- a/sys/kgssapi/gss_impl.c
+++ b/sys/kgssapi/gss_impl.c
@@ -104,10 +104,12 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap)
error = copyinstr(uap->path, path, sizeof(path), NULL);
if (error)
return (error);
+ if (strlen(path) + 1 > sizeof(sun.sun_path))
+ return (EINVAL);
if (path[0] != '\0') {
sun.sun_family = AF_LOCAL;
- strcpy(sun.sun_path, path);
+ strlcpy(sun.sun_path, path, sizeof(sun.sun_path));
sun.sun_len = SUN_LEN(&sun);
nconf = getnetconfigent("local");
OpenPOWER on IntegriCloud