projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dec38c8
)
peel_onion: handle NULL
author
Martin Koegler
<mkoegler@auto.tuwien.ac.at>
Mon, 18 Feb 2008 20:47:58 +0000
(21:47 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 19 Feb 2008 04:49:18 +0000
(20:49 -0800)
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c
patch
|
blob
|
history
diff --git
a/sha1_name.c
b/sha1_name.c
index 4c0bc9c5b5d5257195ee676fe46d1d9129daf7e8..2575ea77f499f8316064c1c96927f391130946a7 100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-494,8
+494,11
@@
static int peel_onion(const char *name, int len, unsigned char *sha1)
return error("%.*s: expected %s type, but the object dereferences to %s type",
len, name, typename(expected_type),
typename(o->type));
+ if (!o)
+ return -1;
if (!o->parsed)
- parse_object(o->sha1);
+ if (!parse_object(o->sha1))
+ return -1;
}
}
return 0;