Fix dispsize for libpq connection parameters channel_binding and gssencmode
authorMichael Paquier
Wed, 29 Jan 2020 06:08:26 +0000 (15:08 +0900)
committerMichael Paquier
Wed, 29 Jan 2020 06:08:26 +0000 (15:08 +0900)
channel_binding's longest allowed value is not "7", it is actually "8".
gssencmode also got that wrong.

A similar mistake has been fixed as of f4051e3.

Backpatch down to v12, where gssencmode has been introduced.

Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20200128053633[email protected]
Backpatch-through: 12

src/interfaces/libpq/fe-connect.c

index e6635136df6a82e1698b04b8e0a5c16bf833d6a2..7b0fb0ea9dc8b03dbf5f17738bdb9d82abdd9c5e 100644 (file)
@@ -313,7 +313,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
     * support.
     */
    {"gssencmode", "PGGSSENCMODE", DefaultGSSMode, NULL,
-       "GSSENC-Mode", "", 7,   /* sizeof("disable") == 7 */
+       "GSSENC-Mode", "", 8,   /* sizeof("disable") == 8 */
    offsetof(struct pg_conn, gssencmode)},
 
    /* Kerberos and GSSAPI authentication support specifying the service name */
@@ -322,7 +322,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
    offsetof(struct pg_conn, krbsrvname)},
 
    {"gsslib", "PGGSSLIB", NULL, NULL,
-       "GSS-library", "", 7,   /* sizeof("gssapi") = 7 */
+       "GSS-library", "", 7,   /* sizeof("gssapi") == 7 */
    offsetof(struct pg_conn, gsslib)},
 
    {"replication", NULL, NULL, NULL,