Avoid possible dereference null pointer (src/backend/catalog/pg_depend.c)
Ranier Vilela <ranier.vf@gmail.com>
From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2024-05-22T14:44:32Z
Lists: pgsql-hackers
Attachments
- fix-catalog-cache-search-check.patch (application/octet-stream) patch
Hi. Per Coverity. 2. returned_null: SearchSysCacheAttName returns NULL (checked 20 out of 21 times). 3. var_assigned: Assigning: ptup = NULL return value from SearchSysCacheAttName. 964 ptup = SearchSysCacheAttName(relid, attname); CID 1545986: (#1 of 1): Dereference null return value (NULL_RETURNS) 4. dereference: Dereferencing ptup, which is known to be NULL. The functions SearchSysCacheAttNum and SearchSysCacheAttName, need to have the result checked. The commit 5091995 <https://github.com/postgres/postgres/commit/509199587df73f06eda898ae13284292f4ae573a>, left an oversight. Fixed by the patch attached, a change of style, unfortunately, was necessary. best regards, Ranier Vilela
Commits
-
Fix potential NULL pointer dereference in getIdentitySequence()
- 8285b484a47d 17.0 landed
-
Fix assorted bugs related to identity column in partitioned tables
- 509199587df7 17.0 cited