Commit 3636efa
committed
Fix parsePGArray() error checking in pg_dump.
Coverity complained about a defect in commit 257836a:
Calling "parsePGArray" without checking return value (as is
done elsewhere 11 out of 13 times).
Fix, and also check for empty strings explicitly (NULL as represented by
PQgetvalue()). That worked correctly before only because parsePGArray()
happens to set *nitems = 0 when it fails on an empty string. Also
convert a sanity check assertion to an error to be more paranoid, and
pgindent a nearby line.
Reported-by: Michael Paquier <michael@paquier.xyz>1 parent 8b39345 commit 3636efa
1 file changed
+20
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18573 | 18573 | | |
18574 | 18574 | | |
18575 | 18575 | | |
18576 | | - | |
18577 | | - | |
18578 | | - | |
18579 | | - | |
18580 | | - | |
18581 | | - | |
18582 | | - | |
| 18576 | + | |
| 18577 | + | |
| 18578 | + | |
| 18579 | + | |
| 18580 | + | |
| 18581 | + | |
| 18582 | + | |
| 18583 | + | |
| 18584 | + | |
| 18585 | + | |
| 18586 | + | |
| 18587 | + | |
| 18588 | + | |
| 18589 | + | |
| 18590 | + | |
| 18591 | + | |
| 18592 | + | |
| 18593 | + | |
| 18594 | + | |
18583 | 18595 | | |
18584 | 18596 | | |
18585 | 18597 | | |
| |||
18594 | 18606 | | |
18595 | 18607 | | |
18596 | 18608 | | |
18597 | | - | |
| 18609 | + | |
18598 | 18610 | | |
18599 | 18611 | | |
18600 | 18612 | | |
| |||
0 commit comments