commit 5a8b373cd01671285df647379299fbc5f49707c1 from: Stefan Sperling date: Fri Dec 18 15:55:18 2020 UTC fix parsing of tag objects which lack a tag message This problem could be triggered with the u-boot repository: $ git clone --bare https://gitlab.denx.de/u-boot/u-boot.git $ got log -r u-boot.git got-read-pack: bad object data got: bad object data $ commit - e8bfb8f3994fa8096bf56db895d969b4961f8b4b commit + 5a8b373cd01671285df647379299fbc5f49707c1 blob - 87a2ed47fc53ce199f828d6f49ba4cd304e3b52f blob + 241ea3c3ccac1133d50d95329813ab14c3d00f3d --- lib/object_parse.c +++ lib/object_parse.c @@ -925,7 +925,7 @@ got_object_parse_tag(struct got_tag_object **tag, uint } s += slen + 1; remain -= slen + 1; - if (remain <= 0) { + if (remain < 0) { err = got_error(GOT_ERR_BAD_OBJ_DATA); goto done; }