From: Vsevolod Stakhov Date: Wed, 25 Mar 2009 14:46:50 +0000 (+0300) Subject: * Fix using of local variable X-Git-Tag: 0.2.7~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7751755b6fe2938baf75a8a3a0521008a0d3c17b;p=thirdparty%2Frspamd.git * Fix using of local variable --- diff --git a/src/message.c b/src/message.c index 6d770bbe8d..d1834c9688 100644 --- a/src/message.c +++ b/src/message.c @@ -211,8 +211,10 @@ reg_char: } break; } - c = *(++p); i++; + if (i < src->len) { + c = *(++p); + } } if (rp < buf->data + src->len) { *rp = '\0'; diff --git a/src/worker.c b/src/worker.c index 1ec5a64dda..cf716ee0dd 100644 --- a/src/worker.c +++ b/src/worker.c @@ -143,7 +143,9 @@ read_socket (f_str_t *in, void *arg) } break; case READ_MESSAGE: - task->msg = in; + task->msg = memory_pool_alloc (task->task_pool, sizeof (f_str_t)); + task->msg->begin = in->begin; + task->msg->len = in->len; msg_debug ("read_socket: got string of length %ld", (long int)task->msg->len); r = process_message (task); if (r == -1) {