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 $
diff --git a/lib/object_parse.c b/lib/object_parse.c
index 87a2ed4..241ea3c 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -925,7 +925,7 @@ got_object_parse_tag(struct got_tag_object **tag, uint8_t *buf, size_t len)
}
s += slen + 1;
remain -= slen + 1;
- if (remain <= 0) {
+ if (remain < 0) {
err = got_error(GOT_ERR_BAD_OBJ_DATA);
goto done;
}