chiark / gitweb /
Dgit.pm: git_cat_file: When passed undef, crash with \n at end
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 9 Oct 2018 22:37:28 +0000 (23:37 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 9 Oct 2018 22:45:08 +0000 (23:45 +0100)
Interpolating $objname into this string means that the crash occors
before "GCFF>| " has been "printed" - but actually sits in a stdio
buffer, waiting to appear after the output from confess.

Reported-by: Mattia Rizzolo <mattia@debian.org>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm

index 39c459837a7c1f73760fa467b5d0a206f90fa697..edc57f12c579f636224d0181efaf2b45d0c59790 100644 (file)
@@ -457,7 +457,7 @@ sub git_cat_file ($;$) {
        debugcmd "GCF|", @cmd;
        $gcf_pid = open2 $gcf_o, $gcf_i, @cmd or confess $!;
     }
-    printdebug "GCF>| ", $objname, "\n";
+    printdebug "GCF>| $objname\n";
     print $gcf_i $objname, "\n" or confess $!;
     my $x = <$gcf_o>;
     printdebug "GCF<| ", $x;