diff --git a/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst b/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst index dd8a091ca08..4973dd25215 100644 --- a/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst +++ b/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst @@ -32,3 +32,5 @@ Synopsis Description ----------- Get the SNI (Server Name Indication) that corresponds to SSL connection :arg:`sslp`. + +If :arg:`length` is not null, the length of the returned string (or 0 if this function returns null) will be stored. diff --git a/src/api/InkAPI.cc b/src/api/InkAPI.cc index 6de5a09bab9..83aba649174 100644 --- a/src/api/InkAPI.cc +++ b/src/api/InkAPI.cc @@ -7929,6 +7929,9 @@ const char * TSVConnSslSniGet(TSVConn sslp, int *length) { if (sslp == nullptr) { + if (length) { + *length = 0; + } return nullptr; }