projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Off-by-one error in get_path_prefix(), found by Valgrind
[git.git]
/
exec_cmd.c
diff --git
a/exec_cmd.c
b/exec_cmd.c
index
12eb364
..
c1539d1
100644
(file)
--- a/
exec_cmd.c
+++ b/
exec_cmd.c
@@
-21,7
+21,7
@@
const char *git_exec_path(void)
return current_exec_path;
env = getenv("GIT_EXEC_PATH");
return current_exec_path;
env = getenv("GIT_EXEC_PATH");
- if (env) {
+ if (env
&& *env
) {
return env;
}
return env;
}
@@
-43,7
+43,7
@@
int execv_git_cmd(const char **argv)
const char *exec_dir = paths[i];
const char *tmp;
const char *exec_dir = paths[i];
const char *tmp;
- if (!exec_dir) continue;
+ if (!exec_dir
|| !*exec_dir
) continue;
if (*exec_dir != '/') {
if (!getcwd(git_command, sizeof(git_command))) {
if (*exec_dir != '/') {
if (!getcwd(git_command, sizeof(git_command))) {