Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 692bd09

Browse files
committed
Use "#ifdef CATALOG_VARLEN" to protect nullable fields of pg_authid.
This gives a stronger guarantee than a mere comment against accessing these fields as simple struct members. Since rolpassword is in fact varlena, it's not clear why these didn't get marked from the beginning, but let's do it now. Michael Paquier
1 parent 09d8d11 commit 692bd09

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/include/catalog/pg_authid.h

+2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MAC
5656
int32 rolconnlimit; /* max connections allowed (-1=no limit) */
5757

5858
/* remaining fields may be null; use heap_getattr to read them! */
59+
#ifdef CATALOG_VARLEN /* variable-length fields start here */
5960
text rolpassword; /* password, if any */
6061
timestamptz rolvaliduntil; /* password expiration time, if any */
62+
#endif
6163
} FormData_pg_authid;
6264

6365
#undef timestamptz

0 commit comments

Comments
 (0)