diff options
Diffstat (limited to 'checkout-index.c')
-rw-r--r-- | checkout-index.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/checkout-index.c b/checkout-index.c index 64bdc3bd13..9876af6fd6 100644 --- a/checkout-index.c +++ b/checkout-index.c @@ -278,7 +278,7 @@ int main(int argc, char **argv) die("git-checkout-index: don't mix '--stdin' and explicit filenames"); p = prefix_path(prefix, prefix_length, arg); checkout_file(p); - if (p != arg) + if (p < arg || p > arg + strlen(arg)) free((char*)p); } @@ -300,7 +300,7 @@ int main(int argc, char **argv) path_name = buf.buf; p = prefix_path(prefix, prefix_length, path_name); checkout_file(p); - if (p != path_name) + if (p < path_name || p > path_name + strlen(path_name)) free((char *)p); if (path_name != buf.buf) free(path_name); |