From: Vsevolod Stakhov Date: Wed, 15 Jun 2016 16:42:45 +0000 (+0100) Subject: [Fix] Fix stack growing X-Git-Tag: 1.3.0~329 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f166c85751692f0a317b0eb129e6ed0557e281a4;p=rspamd.git [Fix] Fix stack growing --- diff --git a/src/ragel/smtp_received.rl b/src/ragel/smtp_received.rl index f4a0ed7ba..dd2212de3 100644 --- a/src/ragel/smtp_received.rl +++ b/src/ragel/smtp_received.rl @@ -51,7 +51,8 @@ prepush { if (top >= st_storage.size) { - st_storage.data = realloc (st_storage.data, (top + 1) * 2); + st_storage.size = (top + 1) * 2; + st_storage.data = realloc (st_storage.data, st_storage.size * sizeof (int)); g_assert (st_storage.data != NULL); stack = st_storage.data; }