shithub: git9

Download patch

ref: 611d84fcf2eb51eff7281321f45d9c8953340a4e
parent: ef4d73c490375846b821d4cd55307cfb6279ccef
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Dec 8 19:33:49 EST 2019

fix crash.

--- a/ref.c
+++ b/ref.c
@@ -162,6 +162,8 @@
 			o = q->obj;
 			for(i = 0; i < o->commit->nparent; i++){
 				p = readobject(o->commit->parent[i]);
+				if(p == nil)
+					goto err;
 				h = hnode(ht, p);
 				if(h->mark != nil){
 					if(h->mark != q->mark){
@@ -176,6 +178,7 @@
 			}
 		}
 		if(q2 == nil){
+err:
 			werrstr("no common ancestor");
 			break;
 		}