Correct some code in pg_restore when reading the header of a tar archive:
(1) The code doesn't initialize `sum', so the initial "does the checksum
match?" test is wrong.
(2) The loop that is intended to check for a "null block" just checks
the first byte of the tar block 512 times, rather than each of the
512 bytes one time (!), which I'm guessing was the intent.
It was only through sheer luck that this worked in the first place.
Per Coverity static analysis performed by EnterpriseDB.
pg_backup_tar.c (r1.47 -> r1.48)
pgsql-committers by date
|Next:||From: Neil Conway||Date: 2005-06-22 02:02:09|
|Subject: pgsql: Correct some code in pg_restore when reading the header of a tar |
|Previous:||From: Neil Conway||Date: 2005-06-22 01:43:05|
|Subject: pgsql: More trivial dead code removal: in int_to_roman(), checking for |