/* Copyright (c) 2007-2008 Dovecot authors, see the included COPYING file */
+/* @UNSAFE: whole file */
+
#include "lib.h"
#include "str-find.h"
unsigned int j, *suffixes;
int i;
- suffixes = t_buffer_get(ctx->key_len);
+ suffixes = t_buffer_get(sizeof(*suffixes) * ctx->key_len);
init_suffixes(ctx, suffixes);
for (i = 0; i < (int)ctx->key_len; i++)
for (i = 0; i <= (int)ctx->key_len - 2; i++)
ctx->goodtab[len_1 - suffixes[i]] = len_1 - i;
}
-
+
struct str_find_context *str_find_init(pool_t pool, const char *key)
{
struct str_find_context *ctx;