"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
fix lib/object_parse.c comparison typo
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Wed, 18 Jan 2023 15:56:03 +1100

Download raw body.

Thread
As per the subject line, fix typo that makes overlapping comparison
always evaluate false:

diff /home/mark/src/got
commit - f4e8c21cb2dc6a468bae32a4dcf3a9e18f269527
path + /home/mark/src/got
blob - d462598db9e15145bb7cda1fc9ca7357de35b04a
file + lib/object_parse.c
--- lib/object_parse.c
+++ lib/object_parse.c
@@ -824,7 +824,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';

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68