diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clientloop.c b/clientloop.c index 5a018ac79..4522a6332 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.265 2015/01/19 20:16:15 markus Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.266 2015/01/20 23:14:00 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -61,9 +61,9 @@ | |||
61 | 61 | ||
62 | #include "includes.h" | 62 | #include "includes.h" |
63 | 63 | ||
64 | #include <sys/param.h> /* MIN MAX */ | ||
64 | #include <sys/types.h> | 65 | #include <sys/types.h> |
65 | #include <sys/ioctl.h> | 66 | #include <sys/ioctl.h> |
66 | #include <sys/param.h> | ||
67 | #ifdef HAVE_SYS_STAT_H | 67 | #ifdef HAVE_SYS_STAT_H |
68 | # include <sys/stat.h> | 68 | # include <sys/stat.h> |
69 | #endif | 69 | #endif |
@@ -85,6 +85,7 @@ | |||
85 | #include <termios.h> | 85 | #include <termios.h> |
86 | #include <pwd.h> | 86 | #include <pwd.h> |
87 | #include <unistd.h> | 87 | #include <unistd.h> |
88 | #include <limits.h> | ||
88 | 89 | ||
89 | #include "openbsd-compat/sys-queue.h" | 90 | #include "openbsd-compat/sys-queue.h" |
90 | #include "xmalloc.h" | 91 | #include "xmalloc.h" |
@@ -339,12 +340,12 @@ client_x11_get_proto(const char *display, const char *xauth_path, | |||
339 | display = xdisplay; | 340 | display = xdisplay; |
340 | } | 341 | } |
341 | if (trusted == 0) { | 342 | if (trusted == 0) { |
342 | xauthdir = xmalloc(MAXPATHLEN); | 343 | xauthdir = xmalloc(PATH_MAX); |
343 | xauthfile = xmalloc(MAXPATHLEN); | 344 | xauthfile = xmalloc(PATH_MAX); |
344 | mktemp_proto(xauthdir, MAXPATHLEN); | 345 | mktemp_proto(xauthdir, PATH_MAX); |
345 | if (mkdtemp(xauthdir) != NULL) { | 346 | if (mkdtemp(xauthdir) != NULL) { |
346 | do_unlink = 1; | 347 | do_unlink = 1; |
347 | snprintf(xauthfile, MAXPATHLEN, "%s/xauthfile", | 348 | snprintf(xauthfile, PATH_MAX, "%s/xauthfile", |
348 | xauthdir); | 349 | xauthdir); |
349 | snprintf(cmd, sizeof(cmd), | 350 | snprintf(cmd, sizeof(cmd), |
350 | "%s -f %s generate %s " SSH_X11_PROTO | 351 | "%s -f %s generate %s " SSH_X11_PROTO |