|
@@ -1702,10 +1702,14 @@ connection_ap_process_natd(edge_connection_t *conn)
|
|
|
}
|
|
|
|
|
|
daddr = tbuf = &tmp_buf[0] + 6;
|
|
|
- while (*tbuf != '\0' && *tbuf != ' ')
|
|
|
- tbuf++;
|
|
|
- *tbuf = '\0';
|
|
|
- tbuf++;
|
|
|
+ if (!(tbuf = strchr(tbuf, ' '))) {
|
|
|
+ log_warn(LD_APP,"Natd handshake was ill-formed; closing. The client "
|
|
|
+ "said: %s",
|
|
|
+ escaped(tmp_buf));
|
|
|
+ connection_mark_unattached_ap(conn, END_STREAM_REASON_INVALID_NATD_DEST);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+ *tbuf++ = '\0';
|
|
|
|
|
|
|
|
|
* send a socks reply down a natd conn */
|