For the ltrim() converter, on success, the area pointer of the sample buffer
is moved forward without updating the buffer size accordingly. If this
converter is followed by another one relying on the buffer size to do some
operations on the buffer area, this could lead to a buffer overflow.
Thanks to Charles Vosburgh <theminershive@gmail.com> for reporting this and
providing the fix.
This patch must be backported to all supported versions.
l--;
}
+ if (smp->data.u.str.size)
+ smp->data.u.str.size -= p - smp->data.u.str.area;
smp->data.u.str.area = p;
smp->data.u.str.data = l;
return 1;