diff options
author | Jack Lloyd <[email protected]> | 2017-11-02 17:10:23 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-11-02 17:10:23 -0400 |
commit | ed4a03da6e04bed8565bc69b1f0c9637b0b4bc3e (patch) | |
tree | ab3e46c74fdff7dd279c468c086b85e43faa4a74 /src/lib/tls | |
parent | d9a456e0b0fe2c3a3f8197f2a3daf7325495010f (diff) |
Avoid saving a session to SQL database with empty hostname
This happens if the hostname is unknown or specified as an IP.
Diffstat (limited to 'src/lib/tls')
-rw-r--r-- | src/lib/tls/sessions_sql/tls_session_manager_sql.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp index 4287172f4..45b3059f5 100644 --- a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp +++ b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp @@ -170,6 +170,9 @@ size_t Session_Manager_SQL::remove_all() void Session_Manager_SQL::save(const Session& session) { + if(session.server_info().hostname().empty()) + return; + auto stmt = m_db->new_statement("insert or replace into tls_sessions" " values(?1, ?2, ?3, ?4, ?5)"); |