summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b683b9)
raw | patch | inline | side by side (parent: 3b683b9)
author | Mike Hommey <mh@glandium.org> | |
Fri, 14 Dec 2007 21:18:01 +0000 (22:18 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Dec 2007 05:31:59 +0000 (21:31 -0800) |
When a downloaded ref doesn't contain a sha1, the error message displays
a random sha1 because of uninitialized memory. This happens when cloning
a repository that is already a clone of another one, in which case
refs/remotes/origin/HEAD is a symref.
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a random sha1 because of uninitialized memory. This happens when cloning
a repository that is already a clone of another one, in which case
refs/remotes/origin/HEAD is a symref.
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history | |
http-walker.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index fc60bfd5f476abc94c3f70b5ea95373bd444e16f..c96e43da163fac00b245f2fe5736494185e40aba 100644 (file)
--- a/http-push.c
+++ b/http-push.c
return error("Unable to start request");
}
+ if (buffer.posn != 41)
+ return 1;
hex[40] = '\0';
- get_sha1_hex(hex, sha1);
- return 0;
+ return get_sha1_hex(hex, sha1);
}
static void one_remote_object(const char *hex)
diff --git a/http-walker.c b/http-walker.c
index a3fb596542eea6d85a6cb32add100e8d71e7713a..0faafbce6164b18cdd960bc8c7d254507d4a2731 100644 (file)
--- a/http-walker.c
+++ b/http-walker.c
return error("Unable to start request");
}
+ if (buffer.posn != 41)
+ return 1;
hex[40] = '\0';
- get_sha1_hex(hex, sha1);
- return 0;
+ return get_sha1_hex(hex, sha1);
}
static void cleanup(struct walker *walker)