mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
git: fix nil dereference in corrupt repositories
This commit is contained in:
parent
cd5bafe7cb
commit
c3ba64f693
2 changed files with 2 additions and 2 deletions
|
@ -280,7 +280,7 @@ fetchpack(Conn *c)
|
|||
if(hasheq(&have[i], &Zhash) || oshas(&hadobj, have[i]))
|
||||
continue;
|
||||
if((o = readobject(have[i])) == nil)
|
||||
sysfatal("missing object we should have: %H", have[i]);
|
||||
sysfatal("missing exected object: %H", have[i]);
|
||||
if(fmtpkt(c, "have %H", o->hash) == -1)
|
||||
sysfatal("write: %r");
|
||||
enqueueparent(&haveq, o);
|
||||
|
|
|
@ -126,7 +126,7 @@ paint(Hash *head, int nhead, Hash *tail, int ntail, Object ***res, int *nres, in
|
|||
|
||||
for(i = 0; i < nhead; i++){
|
||||
if((o = readobject(head[i])) == nil){
|
||||
fprint(2, "warning: %H does not point at commit\n", o->hash);
|
||||
fprint(2, "warning: %H does not point at commit\n", head[i]);
|
||||
werrstr("read head %H: %r", head[i]);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue