aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/rspamdclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/rspamdclient.c')
-rw-r--r--src/client/rspamdclient.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c
index e8f7dfe87..293c49214 100644
--- a/src/client/rspamdclient.c
+++ b/src/client/rspamdclient.c
@@ -151,7 +151,7 @@ rspamd_client_command (struct rspamd_client_connection *conn,
{
struct rspamd_client_request *req;
gchar *p, *hn, *hv;
- gsize remain;
+ gsize remain, old_len;
GHashTableIter it;
req = g_slice_alloc (sizeof (struct rspamd_client_request));
@@ -167,7 +167,10 @@ rspamd_client_command (struct rspamd_client_connection *conn,
p = req->msg->body->str + req->msg->body->len;
remain = req->msg->body->allocated_len - req->msg->body->len - 1;
if (remain == 0) {
- g_string_set_size (req->msg->body, req->msg->body->len * 2);
+ old_len = req->msg->body->len;
+ g_string_set_size (req->msg->body, old_len * 2);
+ req->msg->body->len = old_len;
+ continue;
}
remain = fread (p, 1, remain, in);
if (remain > 0) {