Commit Diff


commit - eed705606091622e7cf0c62cc3b853aa184750f9
commit + a8771ebd4482e832a941f8041ee67663418111f9
blob - c25b1b51046c5e8f1caf61ece410b255a0b9df4d
blob + bd60dd7a2516c5bf34898dbb798f04b990a38115
--- lib/object_parse.c
+++ lib/object_parse.c
@@ -823,7 +823,7 @@ parse_tree_entry(struct got_parsed_tree_entry *pte, si
 	pte->mode = 0;
 	p = buf;
 	while (p < space) {
-		if (*p < '0' && *p > '7')
+		if (*p < '0' || *p > '7')
 			return got_error(GOT_ERR_BAD_OBJ_DATA);
 		pte->mode <<= 3;
 		pte->mode |= *p - '0';