lib/pattern: Fix seg fault when calculating pattern length
authorVincent Fu <vincent.fu@samsung.com>
Mon, 30 Jan 2023 15:37:48 +0000 (10:37 -0500)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 30 Jan 2023 15:46:22 +0000 (10:46 -0500)
commitc6cade164bc7e35e95ba88f816be4f44475e4e23
treea70345beb8ce3304d6eefa111532f6381045c045
parent1e8ec88fd5f3ab4b7bbd0119708d94fd64a4e7ad
lib/pattern: Fix seg fault when calculating pattern length

When --buffer_pattern or --verify_pattern has multiple elements
(0x110x22 or 0xdeadface"abcd"-12'filename') calculating the length
produces a segmentation fault in parse_and_fill_pattern() because it
increments out when out is passed to the parse_* routines it calls.

This patch uses the fix provided in the GitHub issue.

Fixes: https://github.com/axboe/fio/issues/1500
Fixes: 6c9397396eb83a6ce64a998795e7a50552e4337e "lib/pattern: Support
NULL output buffer in parse_and_fill_pattern()"

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
lib/pattern.c