diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-16 12:55:24 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-01-16 12:55:46 +0000 |
commit | 7e0bf487c39571d8fd228a2802f544ac11faa481 (patch) | |
tree | 6001c85de80ee394eeac4baa60cdd1a3f96c0af3 /src | |
parent | cfc7ee6d6824f83e63e79642e6bad6e5ee868c95 (diff) | |
download | rspamd-7e0bf487c39571d8fd228a2802f544ac11faa481.tar.gz rspamd-7e0bf487c39571d8fd228a2802f544ac11faa481.zip |
[Minor] Check string length to avoid OOB reading
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/ssl_util.c | 2 |
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 --; } |