Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Avoid printing uninitialized filename variable in verbose mode
authorMagnus Hagander <magnus@hagander.net>
Sun, 9 Feb 2014 10:54:33 +0000 (11:54 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sun, 9 Feb 2014 11:09:55 +0000 (12:09 +0100)
When using verbose mode for pg_basebackup, in tar format sent to
stdout, we'd print an unitialized buffer as the filename.

Reported by Pontus Lundkvist

src/bin/pg_basebackup/pg_basebackup.c

index 722d54c995f4c47ded37565ad72dab229e5990a2..3ed6d17dd3bbad8b1421823e6e785e161cb343f5 100644 (file)
@@ -300,6 +300,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
            else
 #endif
                tarfile = stdout;
+           strcpy(filename, "-");
        }
        else
        {