summaryrefslogtreecommitdiff
path: root/security/openssh-portable/files/patch-ssh-agent.c
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2003-09-17 16:07:48 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2003-09-17 16:07:48 +0000
commit17f5a3c9fe04b53e16e5e42247e2cb8c0fb38d2f (patch)
tree33b79f1b18d452ba14981f3e0538e9720e2b8b90 /security/openssh-portable/files/patch-ssh-agent.c
parent- Securitry Fix revision 2 (diff)
Add Solar Designer's additional fixes to buffer management.
Notes
Notes: svn path=/head/; revision=89018
Diffstat (limited to 'security/openssh-portable/files/patch-ssh-agent.c')
-rw-r--r--security/openssh-portable/files/patch-ssh-agent.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/security/openssh-portable/files/patch-ssh-agent.c b/security/openssh-portable/files/patch-ssh-agent.c
new file mode 100644
index 000000000000..f50ae308e03c
--- /dev/null
+++ b/security/openssh-portable/files/patch-ssh-agent.c
@@ -0,0 +1,44 @@
+--- ssh-agent.c Sat Mar 15 00:37:09 2003
++++ ssh-agent.c Wed Sep 17 00:42:15 2003
+@@ -767,7 +767,7 @@ process_message(SocketEntry *e)
+ static void
+ new_socket(sock_type type, int fd)
+ {
+- u_int i, old_alloc;
++ u_int i, old_alloc, new_alloc;
+
+ if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
+ error("fcntl O_NONBLOCK: %s", strerror(errno));
+@@ -778,25 +778,26 @@ new_socket(sock_type type, int fd)
+ for (i = 0; i < sockets_alloc; i++)
+ if (sockets[i].type == AUTH_UNUSED) {
+ sockets[i].fd = fd;
+- sockets[i].type = type;
+ buffer_init(&sockets[i].input);
+ buffer_init(&sockets[i].output);
+ buffer_init(&sockets[i].request);
++ sockets[i].type = type;
+ return;
+ }
+ old_alloc = sockets_alloc;
+- sockets_alloc += 10;
++ new_alloc = sockets_alloc + 10;
+ if (sockets)
+- sockets = xrealloc(sockets, sockets_alloc * sizeof(sockets[0]));
++ sockets = xrealloc(sockets, new_alloc * sizeof(sockets[0]));
+ else
+- sockets = xmalloc(sockets_alloc * sizeof(sockets[0]));
+- for (i = old_alloc; i < sockets_alloc; i++)
++ sockets = xmalloc(new_alloc * sizeof(sockets[0]));
++ for (i = old_alloc; i < new_alloc; i++)
+ sockets[i].type = AUTH_UNUSED;
+- sockets[old_alloc].type = type;
++ sockets_alloc = new_alloc;
+ sockets[old_alloc].fd = fd;
+ buffer_init(&sockets[old_alloc].input);
+ buffer_init(&sockets[old_alloc].output);
+ buffer_init(&sockets[old_alloc].request);
++ sockets[old_alloc].type = type;
+ }
+
+ static int