diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/custom/regmark/prefix_tree.c | 4 | ||||
-rw-r--r-- | src/plugins/custom/regmark/regmark.c | 2 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 10 | ||||
-rw-r--r-- | src/plugins/surbl.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/custom/regmark/prefix_tree.c b/src/plugins/custom/regmark/prefix_tree.c index 4d593ebbc..5e8607aae 100644 --- a/src/plugins/custom/regmark/prefix_tree.c +++ b/src/plugins/custom/regmark/prefix_tree.c @@ -82,7 +82,7 @@ add_string_common (prefix_tree_t *tree, const char *input, int skip_levels, gboo else { /* Create new tree */ prefix = g_malloc (cur_level * sizeof (char) + 1); - g_strlcpy (prefix, orig, cur_level + 1); + rspamd_strlcpy (prefix, orig, cur_level + 1); cur->leafs[num].data = g_tree_new_full (compare_prefixes, NULL, g_free, NULL); g_tree_insert (cur->leafs[num].data, prefix, GUINT_TO_POINTER (1)); return 1; @@ -90,7 +90,7 @@ add_string_common (prefix_tree_t *tree, const char *input, int skip_levels, gboo } else { /* Got some node, so check it */ - g_strlcpy (tmp, orig, MIN (sizeof (tmp), cur_level + 1)); + rspamd_strlcpy (tmp, orig, MIN (sizeof (tmp), cur_level + 1)); if ((res = (uintptr_t)g_tree_lookup (cur->leafs[num].data, tmp)) != 0) { if (! read_only) { g_tree_insert (cur->leafs[num].data, g_strdup (tmp), GUINT_TO_POINTER (res + 1)); diff --git a/src/plugins/custom/regmark/regmark.c b/src/plugins/custom/regmark/regmark.c index b28c07183..3b0e50903 100644 --- a/src/plugins/custom/regmark/regmark.c +++ b/src/plugins/custom/regmark/regmark.c @@ -141,7 +141,7 @@ parse_line (const char *line, size_t len, char **output, void *user_data) while (p - line <= len) { if (g_ascii_isspace (*p) || p - line == len) { name = g_malloc (p - line + 1); - g_strlcpy (name, line, p - line + 1); + rspamd_strlcpy (name, line, p - line + 1); if (metaphone (name, 0, &metaname)) { /* Skip spaces */ while (p - line <= len && g_ascii_isspace (*p)) { diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 34b4cba5b..70abea2cd 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -248,7 +248,7 @@ parse_servers_string (gchar *str) port = DEFAULT_PORT; } name = memory_pool_alloc (fuzzy_module_ctx->fuzzy_pool, p - strvec[i]); - g_strlcpy (name, strvec[i], p - strvec[i]); + rspamd_strlcpy (name, strvec[i], p - strvec[i]); if (!inet_aton (name, &addr)) { /* Resolve using dns */ hent = gethostbyname (name); @@ -675,7 +675,7 @@ fuzzy_symbol_callback (struct worker_task *task, void *unused) checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5, image->data->data, image->data->len); /* Construct fake fuzzy hash */ fake_fuzzy = memory_pool_alloc0 (task->task_pool, sizeof (fuzzy_hash_t)); - g_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); + rspamd_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); register_fuzzy_call (task, fake_fuzzy); g_free (checksum); } @@ -692,7 +692,7 @@ fuzzy_symbol_callback (struct worker_task *task, void *unused) checksum = g_compute_checksum_for_data (G_CHECKSUM_MD5, mime_part->content->data, mime_part->content->len); /* Construct fake fuzzy hash */ fake_fuzzy = memory_pool_alloc0 (task->task_pool, sizeof (fuzzy_hash_t)); - g_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); + rspamd_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); register_fuzzy_call (task, fake_fuzzy); g_free (checksum); } @@ -833,7 +833,7 @@ fuzzy_process_handler (struct controller_session *session, f_str_t * in) /* Construct fake fuzzy hash */ fake_fuzzy.block_size = 0; bzero (fake_fuzzy.hash_pipe, sizeof (fake_fuzzy.hash_pipe)); - g_strlcpy (fake_fuzzy.hash_pipe, checksum, sizeof (fake_fuzzy.hash_pipe)); + rspamd_strlcpy (fake_fuzzy.hash_pipe, checksum, sizeof (fake_fuzzy.hash_pipe)); if (! register_fuzzy_controller_call (session, task, &fake_fuzzy, cmd, value, flag, saved)) { /* Cannot write hash */ session->state = STATE_REPLY; @@ -863,7 +863,7 @@ fuzzy_process_handler (struct controller_session *session, f_str_t * in) /* Construct fake fuzzy hash */ fake_fuzzy.block_size = 0; bzero (fake_fuzzy.hash_pipe, sizeof (fake_fuzzy.hash_pipe)); - g_strlcpy (fake_fuzzy.hash_pipe, checksum, sizeof (fake_fuzzy.hash_pipe)); + rspamd_strlcpy (fake_fuzzy.hash_pipe, checksum, sizeof (fake_fuzzy.hash_pipe)); if (! register_fuzzy_controller_call (session, task, &fake_fuzzy, cmd, value, flag, saved)) { /* Cannot write hash */ session->state = STATE_REPLY; diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 8627cbbca..bcaa30021 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -444,7 +444,7 @@ format_surbl_request (memory_pool_t * pool, f_str_t * hostname, struct suffix_it } else if (is_numeric && dots_num == 0) { /* This is number */ - g_strlcpy (num_buf, hostname->begin, MIN (hostname->len + 1, sizeof (num_buf))); + rspamd_strlcpy (num_buf, hostname->begin, MIN (hostname->len + 1, sizeof (num_buf))); errno = 0; ip_num = strtoull (num_buf, NULL, 10); if (errno != 0) { @@ -713,7 +713,7 @@ register_memcached_call (struct uri *url, struct worker_task *task, GTree * url_ cur_param->bufsize = sizeof (gint); sum_str = g_compute_checksum_for_string (G_CHECKSUM_MD5, struri (url), -1); - g_strlcpy (cur_param->key, sum_str, sizeof (cur_param->key)); + rspamd_strlcpy (cur_param->key, sum_str, sizeof (cur_param->key)); g_free (sum_str); selected = (struct memcached_server *)get_upstream_by_hash ((void *)task->cfg->memcached_servers, |