X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/5d935dce63ae975db0efc23e3d94c32b17424444..4d91a5f8f47d93ac55ac573e53e67fdf1f51f9c5:/options.c diff --git a/options.c b/options.c index 4331fc65..a404a8da 100644 --- a/options.c +++ b/options.c @@ -1981,7 +1981,7 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr) if (p[1] == ':') *port_ptr = atoi(p+2); } else { - if ((p = strchr(s, ':')) != NULL) { + if ((p = strchr(s, ':')) != NULL && p < s + hostlen) { hostlen = p - s; *port_ptr = atoi(p+1); }