aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutil/ssl_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/ssl_util.c b/src/libutil/ssl_util.c
index f2898d592..c43ace454 100644
--- a/src/libutil/ssl_util.c
+++ b/src/libutil/ssl_util.c
@@ -401,7 +401,7 @@ rspamd_tls_set_error (gint retcode, const gchar *stage, GError **err)
err_code = last_err;
- if (reason->str[reason->len - 1] == ',') {
+ if (reason->len > 0 && reason->str[reason->len - 1] == ',') {
reason->str[reason->len - 1] = '\0';
reason->len --;
}