]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix potential double free by expclicitly zeroing pointers
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 25 Jan 2024 14:38:18 +0000 (14:38 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 25 Jan 2024 14:38:18 +0000 (14:38 +0000)
src/libserver/re_cache.c

index 62ef26c73672c3fc28a622676539dda70f6bcacb..d51dba6477f8d6f89eff624da69faf05fc4a7267 100644 (file)
@@ -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);