Hi all, I was reviewing the libpq code for the recent SSL protocol patch, and noticed two mistakes with dispsize for the following parameters: - channel_binding should be at 8, the largest value being "require". - gssencmode should be at 8.
In those cases the zero-terminator was forgotten in the count. A similar mistake was done in the past for sslmode that was fixed by f4051e36. It is unlikely that dispsize is being used, but we cannot break that on compatibility grounds, and the current numbers are incorrect so let's fix it. Thoughts? -- Michael
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 8498f32f8d..c57dee4e27 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -215,7 +215,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = { offsetof(struct pg_conn, pgpassfile)}, {"channel_binding", "PGCHANNELBINDING", NULL, NULL, - "Channel-Binding", "", 7, /* sizeof("require") */ + "Channel-Binding", "", 8, /* sizeof("require") == 8 */ offsetof(struct pg_conn, channel_binding)}, {"connect_timeout", "PGCONNECT_TIMEOUT", NULL, NULL, @@ -333,7 +333,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 */ @@ -342,7 +342,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,
signature.asc
Description: PGP signature