forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit05db8b5

Neil Conway
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.1 parent06ecacd commit05db8b5
1 file changed
+9
-9
lines changedLines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
| 19 | + | |
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| |||
1155 | 1155 |
| |
1156 | 1156 |
| |
1157 | 1157 |
| |
1158 |
| - | |
1159 | 1158 |
| |
1160 | 1159 |
| |
1161 | 1160 |
| |
| |||
1178 | 1177 |
| |
1179 | 1178 |
| |
1180 | 1179 |
| |
1181 |
| - | |
| 1180 | + | |
1182 | 1181 |
| |
1183 | 1182 |
| |
1184 | 1183 |
| |
| |||
1188 | 1187 |
| |
1189 | 1188 |
| |
1190 | 1189 |
| |
1191 |
| - | |
| 1190 | + | |
| 1191 | + | |
1192 | 1192 |
| |
1193 | 1193 |
| |
1194 |
| - | |
1195 |
| - | |
| 1194 | + | |
| 1195 | + | |
1196 | 1196 |
| |
1197 |
| - | |
1198 | 1197 |
| |
1199 | 1198 |
| |
1200 | 1199 |
| |
1201 | 1200 |
| |
| 1201 | + | |
| 1202 | + | |
1202 | 1203 |
| |
1203 | 1204 |
| |
1204 |
| - | |
| 1205 | + | |
1205 | 1206 |
| |
1206 | 1207 |
| |
1207 | 1208 |
| |
| |||
1213 | 1214 |
| |
1214 | 1215 |
| |
1215 | 1216 |
| |
1216 |
| - | |
1217 | 1217 |
| |
1218 | 1218 |
| |
1219 | 1219 |
| |
|
0 commit comments
Comments
(0)