diff options
author | Jim Meyering <meyering@redhat.com> | 2009-09-12 10:43:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-09-13 01:32:20 -0700 |
commit | 41698375ada57d51cf6db5cf25970ccd1b918180 (patch) | |
tree | a1ed2b0f32a829bdb0b4cece3d85df933b924962 /upload-pack.c | |
parent | use write_str_in_full helper to avoid literal string lengths (diff) | |
download | tgif-41698375ada57d51cf6db5cf25970ccd1b918180.tar.xz |
don't dereference NULL upon fdopen failure
There were several unchecked use of fdopen(); replace them with xfdopen()
that checks and dies.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/upload-pack.c b/upload-pack.c index b3471e417d..38ddac2e86 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -108,7 +108,7 @@ static int do_rev_list(int fd, void *create_full_pack) int i; struct rev_info revs; - pack_pipe = fdopen(fd, "w"); + pack_pipe = xfdopen(fd, "w"); init_revisions(&revs, NULL); revs.tag_objects = 1; revs.tree_objects = 1; @@ -255,7 +255,7 @@ static void create_pack_file(void) /* pass on revisions we (don't) want */ if (!shallow_nr) { - FILE *pipe_fd = fdopen(pack_objects.in, "w"); + FILE *pipe_fd = xfdopen(pack_objects.in, "w"); if (!create_full_pack) { int i; for (i = 0; i < want_obj.nr; i++) |