From 5357cb7b5cb93fc9b20d4d95b093d6b9f86b7727 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 23 Jun 2022 14:20:17 +0200 Subject: intervals: fix crash when trying to remove element in empty set The set deletion routine expects an initialized set, otherwise it crashes. Fixes: 3e8d934e4f72 ("intervals: support to partial deletion with automerge") Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/sets/errors_0 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tests/shell/testcases/sets/errors_0 (limited to 'tests/shell') diff --git a/tests/shell/testcases/sets/errors_0 b/tests/shell/testcases/sets/errors_0 new file mode 100755 index 00000000..2960b694 --- /dev/null +++ b/tests/shell/testcases/sets/errors_0 @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +RULESET="table ip x { + set y { + type ipv4_addr + flags interval + } +} + +delete element ip x y { 2.3.4.5 }" + +$NFT -f - <<< $RULESET || exit 0 -- cgit v1.2.3