The documentation says that PQsslAttribute(conn, "alpn") returns an
empty string if ALPN is not used, but the code actually returned
NULL. Fix the code to match the documentation.
Reported-by: Michael Paquier
Discussion: https://www.postgresql.org/message-id/
[email protected]
protocol ? protocol : _("unknown"),
cipher ? cipher : _("unknown"),
(compression && strcmp(compression, "off") != 0) ? _("on") : _("off"),
- alpn ? alpn : _("none"));
+ (alpn && alpn[0] != '\0') ? alpn : _("none"));
}
/*
SSL_get0_alpn_selected(conn->ssl, &data, &len);
if (data == NULL || len == 0 || len > sizeof(alpn_str) - 1)
- return NULL;
+ return "";
memcpy(alpn_str, data, len);
alpn_str[len] = 0;
return alpn_str;