No error checking when reading from file using zstd in pg_dump
Evgeniy Gorbanev <gorbanyoves@basealt.ru>
From: Evgeniy Gorbanev <gorbanyoves@basealt.ru>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-06-16T08:14:36Z
Lists: pgsql-hackers
Attachments
- compress_zstd.diff (text/x-patch) patch
Hello. In src/bin/pg_dump/compress_zstd.c, the Zstd_read function always returns true. But if you look at the Zstd_gets and Zstd_getc functions, where Zstd_read is called via CFH->read_func, it is expected that the Zstd_read function can also return false. In case of a read-from-file error, the process is expected to terminate, but pg_dump will continue the process. I assume that after checking if (cnt == 0) should be return false; Patch attached. Found by Linux Verification Center (linuxtesting.org) with SVACE. Reporter: Evgeniy Gorbanev (gorbanyoves@basealt.ru). Organization: BaseALT (org@basealt.ru). Best regards, Evgeniy
Commits
-
pg_dump: Fix compression API errorhandling
- ec017a305bd4 16.11 landed
- e686010c5b47 19 (unreleased) landed
- 92268b35d04c 17.7 landed
- 8980c724b559 18.0 landed