]> git.baikalelectronics.ru Git - uboot.git/commit
setexpr: Split the core logic into its own function
authorSimon Glass <sjg@chromium.org>
Sun, 1 Nov 2020 21:15:39 +0000 (14:15 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 1 Dec 2020 15:33:38 +0000 (10:33 -0500)
commit25fc1aabec7f474e32dfcff3086d99eee8030949
treeda95bc331ed888120f361fc199d512a9b0e86156
parent744217e6d63edf463dadd404e47ba85fb97cb43b
setexpr: Split the core logic into its own function

At present this function always allocates a large amount of stack, and
selects its own size for buffers. This makes it hard to test the code
for buffer overflow.

Separate out the inner logic of the substitution so that tests can call
this directly. This will allow checking that the algorithm does not
overflow the buffer.

Fix up one of the error lines at the same time, since it should be
printing nbuf_size, not data_size.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/setexpr.c