summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-01-25 14:38:18 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-01-25 14:38:18 +0000
commit4015346e2f679c1b036e3aafe94c36e4e5a391c4 (patch)
treebf5578978d874bf0dcc075405e0f57241e6563ab
parent04f6599ad750e8381626a6e92e05448ceab32732 (diff)
downloadrspamd-4015346e2f679c1b036e3aafe94c36e4e5a391c4.tar.gz
rspamd-4015346e2f679c1b036e3aafe94c36e4e5a391c4.zip
[Fix] Fix potential double free by expclicitly zeroing pointers
-rw-r--r--src/libserver/re_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 62ef26c73..d51dba647 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 Vsevolod Stakhov
+ * Copyright 2024 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1127,13 +1127,13 @@ rspamd_re_cache_exec_re(struct rspamd_task *task,
guint ret = 0, i, re_id;
struct rspamd_mime_header *rh;
const gchar *in;
- const guchar **scvec;
- guint *lenvec;
+ const guchar **scvec = NULL;
+ guint *lenvec = NULL;
gboolean raw = FALSE, processed_hyperscan = FALSE;
struct rspamd_mime_text_part *text_part;
struct rspamd_mime_part *mime_part;
struct rspamd_url *url;
- guint len, cnt;
+ guint len = 0, cnt = 0;
const gchar *class_name;
class_name = rspamd_re_cache_type_to_string(re_class->type);