aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-09-27 20:48:13 +0700
committerJonathan Nieder <jrnieder@gmail.com>2013-09-27 14:47:49 -0700
commit8d3d28f5dba94a15a79975e4adc909c295c80d80 (patch)
tree310219cae29092db240094ab7719336c6b38f5c5 /builtin
parent60003340cda05f5ecd79ee8522b21eda038b994b (diff)
downloadgit-8d3d28f5dba94a15a79975e4adc909c295c80d80.tar.gz
git-8d3d28f5dba94a15a79975e4adc909c295c80d80.tar.xz
clone: tighten "local paths with colons" check a bit
commit 6000334 (clone: allow cloning local paths with colons in them - 2013-05-04) made it possible to specify a path that has colons in it without file://, e.g. ../foo:bar/somewhere. But the check was a bit sloppy. Consider the url '[foo]:bar'. The '[]' unwrapping code will turn the string to 'foo\0:bar'. In effect this new string is the same as 'foo/:bar' in the check "path < strchrnul(host, '/')", which mistakes it for a local path (with '/' before the first ':') when it's actually not. So disable the check for '/' before ':' when the URL has been mangled by '[]' unwrapping. [jn: with tests from Jeff King] Noticed-by: Morten Stenshorne <mstensho@opera.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions