]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: 51d: possible incorrect operations on smp->data.str.str
authorDragan Dosen <ddosen@haproxy.com>
Tue, 7 Jul 2015 14:10:43 +0000 (16:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2015 15:19:33 +0000 (17:19 +0200)
commit96a0be78ed1a0d7a473c7f8a301174c3afdc06f6
treec07eeace647edd13f5f5bd24176a8f5fe2090604
parent2fbcafc9ce5d5f76b7d5fc0903c0b9019cb32d25
BUG/MEDIUM: 51d: possible incorrect operations on smp->data.str.str

In src/51d.c, the function _51d_conv(), a final '\0' is added into
smp->data.str.str, which can cause a problem if the SMP_F_CONST flag is
set in smp->flags or if smp->data.str.size is not available.

This patch adds a check on smp->flags and smp->data.str.size, and copies
the smp->data.str.str to another buffer by using smp_dup(). If necessary,
the "const" flag is set after device detection. Also, this patch removes
the unnecessary call to chunk_reset() on temp argument.
src/51d.c