cmdline: fix dynamic tokens parsing
authorXueming Li <xuemingl@mellanox.com>
Fri, 19 Jan 2018 18:16:10 +0000 (02:16 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 25 Jan 2018 22:13:57 +0000 (23:13 +0100)
commit2acf7432ad3e67f676d7d14a6acc3b90a2d9117e
treea29cce4570ce72d944618575348fd85fd60c2bb8
parentda9ac508c3b77c83c201dd01d7736ccf139d1767
cmdline: fix dynamic tokens parsing

When using dynamic tokens, the result buffer contains pointers to some
location inside the result buffer. When the content of the temporary
buffer is copied in the final one, these pointers still point to the
temporary buffer.

This works until the temporary buffer is kept intact, but the next
commit introduces a memset() that breaks this assumption.

This commit keeps the successfully parsed buffers, and ensures that the
pointers point to the valid location, by using temp buffer for following
parsing.

Fixes: 9b3fbb051d2e ("cmdline: fix parsing")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_cmdline/cmdline_parse.c