From 3865c430c572b3aa0d48991b9bb86a9e64b45a12 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 30 Mar 2020 18:30:09 +0000 Subject: [PATCH] viewvcs: stream_blob_parse_hdr: fix BIN_DETECT retries git-cat-file(1) may return less than the $BIN_DETECT value for some blobs, so ensure we repopulate the values in $ctx for retries in that case, otherwise we'll lose `$ctx->{-res}' and die when attempting to use `undef' as an array ref. --- lib/PublicInbox/ViewVCS.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm index 069937c1..9ec04f48 100644 --- a/lib/PublicInbox/ViewVCS.pm +++ b/lib/PublicInbox/ViewVCS.pm @@ -58,6 +58,7 @@ sub stream_blob_parse_hdr { # {parse_hdr} for Qspawn warn "premature EOF on $oid $$logref\n"; return html_page($ctx, 500, $logref); } + @$ctx{qw(-res -logref)} = ($res, $logref); undef; # bref keeps growing } } -- 2.44.0