Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-12-28 21:00:39 +0300
committerPetr Štetiar <ynezz@true.cz>2019-12-28 23:17:46 +0300
commitcd75136b1342e1e9dabf921be13240c6653640ed (patch)
treeda548e77a0846762c7f323cbaea439cfb7201f00 /tests/cram
parenteb7eb6393d47a918c420f5b287946dbd6c0d5f57 (diff)
blobmsg: fix wrong payload len passed from blobmsg_check_array
Fix incorrect use of blob_raw_len() on passed blobmsg to blobmsg_check_array_len() introduced in commit b0e21553ae8c ("blobmsg: add _len variants for all attribute checking methods") by using correct blobmsg_len(). This wrong (higher) length was then for example causing issues in procd's instance_config_parse_command() where blobmsg_check_attr_list() was failing sanity checking of service command, thus resulting in the startup failures of some services like collectd, nlbwmon and samba4. Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020840.html Fixes: b0e21553ae8c ("blobmsg: add _len variants for all attribute checking methods") Reported-by: Hannu Nyman <hannu.nyman@welho.com> Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'tests/cram')
-rw-r--r--tests/cram/inputs/procd-instance-nlbwmon.binbin0 -> 492 bytes
-rw-r--r--tests/cram/test_blobmsg_procd_instance.t11
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/cram/inputs/procd-instance-nlbwmon.bin b/tests/cram/inputs/procd-instance-nlbwmon.bin
new file mode 100644
index 0000000..db7748a
--- /dev/null
+++ b/tests/cram/inputs/procd-instance-nlbwmon.bin
Binary files differ
diff --git a/tests/cram/test_blobmsg_procd_instance.t b/tests/cram/test_blobmsg_procd_instance.t
new file mode 100644
index 0000000..87404d5
--- /dev/null
+++ b/tests/cram/test_blobmsg_procd_instance.t
@@ -0,0 +1,11 @@
+check that blobmsg parsing/checking would produce expected results in procd:
+
+ $ [ -n "$TEST_BIN_DIR" ] && export PATH="$TEST_BIN_DIR:$PATH"
+ $ export INPUTS="$TESTDIR/inputs"
+
+ $ for blob in $(LC_ALL=C find $INPUTS -type f | sort ); do
+ > valgrind --quiet --leak-check=full test-blobmsg-procd-instance $blob; \
+ > test-blobmsg-procd-instance-san $blob; \
+ > done
+ procd-instance-nlbwmon.bin: OK
+ procd-instance-nlbwmon.bin: OK