Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
merge-recur: fix thinko in unique_path()
author
Johannes Schindelin
<Johannes.Schindelin@gmx.de>
Sun, 30 Jul 2006 16:35:21 +0000
(18:35 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 30 Jul 2006 21:23:00 +0000
(14:23 -0700)
This could result in a nasty infinite loop, or in bogus names (it used
the strlen() of the newly allocated buffer instead of the original
buffer).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
a060b80
)
diff --git
a/merge-recursive.c
b/merge-recursive.c
index 6a796f24c7f3cdba2c6c2dc1c93bdfcd0c5c2ea1..5375a1ba307e866f23900d9088f06e21ae5c997d 100644
(file)
--- a/
merge-recursive.c
+++ b/
merge-recursive.c
@@
-477,9
+477,9
@@
static char *unique_path(const char *path, const char *branch)
char *newpath = xmalloc(strlen(path) + 1 + strlen(branch) + 8 + 1);
int suffix = 0;
struct stat st;
- char *p = newpath + strlen(
new
path);
+ char *p = newpath + strlen(path);
strcpy(newpath, path);
-
strcat(newpath, "~")
;
+
*(p++) = '~'
;
strcpy(p, branch);
for (; *p; ++p)
if ('/' == *p)