]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
ui-plain: fix to show a repo's root directory listing in plain view
[ps-cgit] / ui-plain.c
index ff85113718464ddbcf68af205a2fae1b6e3e86d1..97cf6394e7021f6a2935b1d98a632eb1da8f81ba 100644 (file)
@@ -143,7 +143,7 @@ static int walk_tree(const unsigned char *sha1, struct strbuf *base,
                        walk_tree_ctx->match = 2;
                        return READ_TREE_RECURSIVE;
                }
-       } else if (base->len > walk_tree_ctx->match_baselen) {
+       } else if (base->len < INT_MAX && (int)base->len > walk_tree_ctx->match_baselen) {
                print_dir_entry(sha1, base->buf, base->len, pathname, mode);
                walk_tree_ctx->match = 2;
        } else if (S_ISDIR(mode)) {