|
Lines 116-122
send_msg(struct sftp_conn *conn, struct
Link Here
|
| 116 |
} |
116 |
} |
| 117 |
|
117 |
|
| 118 |
static void |
118 |
static void |
| 119 |
get_msg(struct sftp_conn *conn, struct sshbuf *m) |
119 |
get_msg_extended(struct sftp_conn *conn, struct sshbuf *m, int initial) |
| 120 |
{ |
120 |
{ |
| 121 |
u_int msg_len; |
121 |
u_int msg_len; |
| 122 |
u_char *p; |
122 |
u_char *p; |
|
Lines 135-141
get_msg(struct sftp_conn *conn, struct s
Link Here
|
| 135 |
if ((r = sshbuf_get_u32(m, &msg_len)) != 0) |
135 |
if ((r = sshbuf_get_u32(m, &msg_len)) != 0) |
| 136 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
136 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
| 137 |
if (msg_len > SFTP_MAX_MSG_LENGTH) |
137 |
if (msg_len > SFTP_MAX_MSG_LENGTH) |
| 138 |
fatal("Received message too long %u", msg_len); |
138 |
fatal("Received message too long %u%s", msg_len, |
|
|
139 |
initial ? " (is your shell clean?)" : ""); |
| 139 |
|
140 |
|
| 140 |
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0) |
141 |
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0) |
| 141 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
142 |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
|
Lines 150-155
get_msg(struct sftp_conn *conn, struct s
Link Here
|
| 150 |
} |
151 |
} |
| 151 |
|
152 |
|
| 152 |
static void |
153 |
static void |
|
|
154 |
get_msg(struct sftp_conn *conn, struct sshbuf *m) |
| 155 |
{ |
| 156 |
get_msg_extended(conn, m, 0); |
| 157 |
} |
| 158 |
|
| 159 |
static void |
| 153 |
send_string_request(struct sftp_conn *conn, u_int id, u_int code, const char *s, |
160 |
send_string_request(struct sftp_conn *conn, u_int id, u_int code, const char *s, |
| 154 |
u_int len) |
161 |
u_int len) |
| 155 |
{ |
162 |
{ |
|
Lines 392-398
do_init(int fd_in, int fd_out, u_int tra
Link Here
|
| 392 |
|
399 |
|
| 393 |
sshbuf_reset(msg); |
400 |
sshbuf_reset(msg); |
| 394 |
|
401 |
|
| 395 |
get_msg(ret, msg); |
402 |
get_msg_extended(ret, msg, 1); |
| 396 |
|
403 |
|
| 397 |
/* Expecting a VERSION reply */ |
404 |
/* Expecting a VERSION reply */ |
| 398 |
if ((r = sshbuf_get_u8(msg, &type)) != 0) |
405 |
if ((r = sshbuf_get_u8(msg, &type)) != 0) |