=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- src/usr.bin/ssh/channels.c 1999/11/24 20:02:11 1.28 +++ src/usr.bin/ssh/channels.c 1999/11/24 20:07:25 1.29 @@ -16,7 +16,7 @@ */ #include "includes.h" -RCSID("$Id: channels.c,v 1.28 1999/11/24 20:02:11 markus Exp $"); +RCSID("$Id: channels.c,v 1.29 1999/11/24 20:07:25 markus Exp $"); #include "ssh.h" #include "packet.h" @@ -1020,13 +1020,16 @@ host_port = packet_get_int(); /* Get remote originator name. */ - if (have_hostname_in_open) + if (have_hostname_in_open) { originator_string = packet_get_string(&originator_len); - else + originator_len += 4; /* size of packet_int */ + } else { originator_string = xstrdup("unknown (remote did not supply name)"); + originator_len = 0; /* no originator supplied */ + } packet_integrity_check(payload_len, - 4 + 4 + host_len + 4 + 4 + originator_len, + 4 + 4 + host_len + 4 + originator_len, SSH_MSG_PORT_OPEN); /* Check if opening that port is permitted. */ @@ -1225,13 +1228,16 @@ remote_channel = packet_get_int(); /* Get remote originator name. */ - if (have_hostname_in_open) + if (have_hostname_in_open) { remote_host = packet_get_string(&remote_len); - else + remote_len += 4; + } else { remote_host = xstrdup("unknown (remote did not supply name)"); + remote_len = 0; + } debug("Received X11 open request."); - packet_integrity_check(payload_len, 4 + 4 + remote_len, SSH_SMSG_X11_OPEN); + packet_integrity_check(payload_len, 4 + remote_len, SSH_SMSG_X11_OPEN); /* Try to open a socket for the local X server. */ display = getenv("DISPLAY");