projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Report errors in store_host_key too.
[u/mdw/putty]
/
unix
/
uxagentc.c
diff --git
a/unix/uxagentc.c
b/unix/uxagentc.c
index
7b737d1
..
5734a7b
100644
(file)
--- a/
unix/uxagentc.c
+++ b/
unix/uxagentc.c
@@
-17,7
+17,8
@@
int agent_exists(void)
{
int agent_exists(void)
{
- if (getenv("SSH_AUTH_SOCK") != NULL)
+ const char *p = getenv("SSH_AUTH_SOCK");
+ if (p && *p)
return TRUE;
return FALSE;
}
return TRUE;
return FALSE;
}
@@
-74,13
+75,12
@@
static int agent_select_result(int fd, int event)
}
conn->retlen += ret;
if (conn->retsize == 4 && conn->retlen == 4) {
}
conn->retlen += ret;
if (conn->retsize == 4 && conn->retlen == 4) {
- conn->retsize =
GET_32BIT(conn->retbuf
);
+ conn->retsize =
toint(GET_32BIT(conn->retbuf) + 4
);
if (conn->retsize <= 0) {
conn->retbuf = NULL;
conn->retlen = 0;
goto done;
}
if (conn->retsize <= 0) {
conn->retbuf = NULL;
conn->retlen = 0;
goto done;
}
- conn->retsize += 4;
assert(conn->retbuf == conn->sizebuf);
conn->retbuf = snewn(conn->retsize, char);
memcpy(conn->retbuf, conn->sizebuf, 4);
assert(conn->retbuf == conn->sizebuf);
conn->retbuf = snewn(conn->retsize, char);
memcpy(conn->retbuf, conn->sizebuf, 4);
@@
-122,7
+122,7
@@
int agent_query(void *in, int inlen, void **out, int *outlen,
exit(1);
}
exit(1);
}
-
fcntl(sock, F_SETFD, FD_CLOEXEC
);
+
cloexec(sock
);
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, name, sizeof(addr.sun_path));
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, name, sizeof(addr.sun_path));