From: Frank Sorenson <frank@tuxrocks.com>
To: Git Mailing List <git@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] Fix git-fsck-cache segfault on invalid tag
Date: Fri, 20 May 2005 01:00:41 -0600 [thread overview]
Message-ID: <428D8B19.4070605@tuxrocks.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
git-fsck-cache will segfault if a tag contains a non-existent sha1. This
patch fixes fsck-cache to report the invalid tag and not die.
- ---
commit a6a237ee3f3d2f5d76499b8f32f58057c9b4cd2d
tree ac5d65a040c22194ddcd0706dc5f0b8bb52aef65
parent 5cd4c7b7686d334e341b21d92449349feda3ef65
author Frank Sorenson <frank@tuxrocks.com> Fri, 20 May 2005 00:52:59 -0600
committer Frank Sorenson <frank@tuxrocks.com> Fri, 20 May 2005 00:52:59 -0600
fsck-cache.c | 4 ++++
1 files changed, 4 insertions(+)
Index: fsck-cache.c
===================================================================
- --- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/fsck-cache.c (mode:100644)
+++ ac5d65a040c22194ddcd0706dc5f0b8bb52aef65/fsck-cache.c (mode:100644)
@@ -315,6 +315,10 @@
return;
obj = lookup_object(sha1);
+ if (!obj) {
+ fprintf(stderr, "invalid tag %s - %s\n", path, hexname);
+ return;
+ }
obj->used = 1;
mark_reachable(obj, REACHABLE);
}
Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
frank@tuxrocks.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCjYsZaI0dwg4A47wRAn2PAJ9hyoev3stnaN0Qn2wWlBJEKiucQACgvT9Z
rVazYmUFj3nXvJDYaBoSRsM=
=KbSv
-----END PGP SIGNATURE-----
next reply other threads:[~2005-05-20 7:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-20 7:00 Frank Sorenson [this message]
2005-05-20 8:50 ` [PATCH] Fix git-fsck-cache segfault on invalid tag Petr Baudis
2005-05-20 13:58 ` Junio C Hamano
2005-05-20 14:36 ` Frank Sorenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=428D8B19.4070605@tuxrocks.com \
--to=frank@tuxrocks.com \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox