Thread (25 messages) flat view 25 messages, 7 authors, 2017-05-30
STALE3396d

[PATCH v3 03/13] clone: use xfopen() instead of fopen()

From: Junio C Hamano <hidden>
Date: 2017-05-26 03:35:25
Subsystem: the rest · Maintainer: Linus Torvalds

From: Nguyễn Thái Ngọc Duy <redacted>

copy_alternates() called fopen() without handling errors. By switching
to xfopen(), this bug is fixed.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index de85b85254..dde4fe73af 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -357,7 +357,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
 	 * to turn entries with paths relative to the original
 	 * absolute, so that they can be used in the new repository.
 	 */
-	FILE *in = fopen(src->buf, "r");
+	FILE *in = xfopen(src->buf, "r");
 	struct strbuf line = STRBUF_INIT;
 
 	while (strbuf_getline(&line, in) != EOF) {
-- 
2.13.0-491-g71cfeddc25
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help