summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1044621)
could have got away with upping it to 256, but I didn't want a repeat
of the chaos when some server accidentally breaks that limit too...)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1019
cda61777-01e9-0310-a592-
d414129be87e
}
static int do_ssh_init(unsigned char c) {
}
static int do_ssh_init(unsigned char c) {
- static char vstring[80];
- static char vlog[sizeof(vstring)+20];
+ static char *vstring;
+ static int vstrsize;
+ static char *vlog;
crReturn(1); /* get another character */
}
crReturn(1); /* get another character */
}
+ vstring = smalloc(16);
+ vstrsize = 16;
i = 0;
while (1) {
crReturn(1); /* get another char */
i = 0;
while (1) {
crReturn(1); /* get another char */
- if (vsp < vstring+sizeof(vstring)-1)
- *vsp++ = c;
+ if (vslen >= vstrsize-1) {
+ vstrsize += 16;
+ vstring = srealloc(vstring, vstrsize);
+ }
+ vstring[vslen++] = c;
if (i >= 0) {
if (c == '-') {
version[i] = '\0';
if (i >= 0) {
if (c == '-') {
version[i] = '\0';
ssh_agentfwd_enabled = FALSE;
rdpkt2_state.incoming_sequence = 0;
ssh_agentfwd_enabled = FALSE;
rdpkt2_state.incoming_sequence = 0;
+ vstring[vslen] = 0;
+ if (vslen > 80)
+ vlog = smalloc(20 + vslen);
+ else
+ vlog = smalloc(100);
sprintf(vlog, "Server version: %s", vstring);
ssh_detect_bugs(vstring);
vlog[strcspn(vlog, "\r\n")] = '\0';
sprintf(vlog, "Server version: %s", vstring);
ssh_detect_bugs(vstring);
vlog[strcspn(vlog, "\r\n")] = '\0';
}
ssh_state = SSH_STATE_BEFORE_SIZE;
}
ssh_state = SSH_STATE_BEFORE_SIZE;
+ sfree(vstring);
+ sfree(vlog);
+