From mboxrd@z Thu Jan 1 00:00:00 1970 From: june at causal.agency (C. McEnroe) Date: Wed, 18 Dec 2019 16:52:30 -0500 Subject: [PATCH 1/2] ui-blame: bail if blob is binary Message-ID: <20191218215231.10961-1-june@causal.agency> This avoids piping binary blobs through the source-filter. --- ui-blame.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui-blame.c b/ui-blame.c index 644c30a..ecbe325 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -151,6 +151,10 @@ static void print_object(const struct object_id *oid, const char *path, cgit_tree_link("tree", NULL, NULL, ctx.qry.head, rev, path); html(")\n"); + if (buffer_is_binary(buf, size)) { + html("
blob is binary.
"); + goto cleanup; + } if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) { htmlf("
blob size (%ldKB)" " exceeds display size limit (%dKB).
", -- 2.23.0