Fixed modutil_replace_SQL not modifying the packet length when the replacement was shorter.

This commit is contained in:
Markus Makela 2015-02-16 12:10:48 +02:00
parent 9dfa4378b4
commit f54b57d987

View File

@ -206,6 +206,10 @@ GWBUF *addition;
/* New SQL is shorter */
memcpy(ptr, sql, newlength);
GWBUF_RTRIM(orig, (length - 1) - newlength);
ptr = GWBUF_DATA(orig);
*ptr++ = (newlength + 1) & 0xff;
*ptr++ = ((newlength + 1) >> 8) & 0xff;
*ptr++ = ((newlength + 1) >> 16) & 0xff;
}
else
{