X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/da326cf3632cb9fe5806c1e9218155f79e93b2f61a9a1a21280b0056d8c2c106..8689035ae762ebf2a2fef1b1d88ffd13a042cfc228b8d756ea0a39dc6f9a957d:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index e4c20cc..d2b92f5 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1061,6 +1061,11 @@ sub git_get_hash_by_path { my $line = <$fd>; close $fd or return undef; + if (!defined $line) { + # there is no tree or hash given by $path at $base + return undef; + } + #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c' $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t/; if (defined $type && $type ne $2) { @@ -1377,8 +1382,12 @@ sub parse_commit_text { pop @commit_lines; # Remove '\0' + if (! @commit_lines) { + return; + } + my $header = shift @commit_lines; - if (!($header =~ m/^[0-9a-fA-F]{40}/)) { + if ($header !~ m/^[0-9a-fA-F]{40}/) { return; } ($co{'id'}, my @parents) = split ' ', $header; @@ -3410,6 +3419,11 @@ sub git_tag { git_header_html(); git_print_page_nav('','', $head,undef,$head); my %tag = parse_tag($hash); + + if (! %tag) { + die_error(undef, "Unknown tag object"); + } + git_print_header_div('commit', esc_html($tag{'name'}), $hash); print "
\n" . "\n" .