Thread (1 message) 1 message, 1 author, 2020-03-24

Re: [PATCH v3 1/1] midx.c: fix an integer overflow

From: Junio C Hamano <hidden>
Date: 2020-03-24 18:48:58

Jeff King [off-list ref] writes:
I'd be OK with just this, but adding a binary t/t5319/zero-objs.midx
would be fine by me, too.
Yup, that sounds like a simple way to make sure we won't regress.
One minor style nit:
quoted
@@ -1124,6 +1130,13 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
 				    i, oid_fanout1, oid_fanout2, i + 1);
 	}
 
+	if (m->num_objects == 0) {
+		midx_report(_("the midx contains no oid"));
+		// remaining tests assume that we have objects, so we can
+		// return here
+		return verify_midx_error;
+	}
We prefer /**/ for comments, like:

  /*
   * Remaining tests assume that we have objects, so we can
   * return here.
   */
Thanks for catching it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help