summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZhiqi Chen <chenzhiqi.123@bytedance.com>2023-05-10 16:35:37 +0800
committerIlya Maximets <i.maximets@ovn.org>2023-05-11 21:11:36 +0200
commitffb8b743bb7706f6b33d0b329d011bf163976652 (patch)
tree0b87fe9434ecd33da5333e3219504daed5b83157 /tests
parentcd608cf96eb93ebc4aa44d1393b9cb00bfde46e5 (diff)
downloadopenvswitch-ffb8b743bb7706f6b33d0b329d011bf163976652.tar.gz
dpctl: Fix dereferencing null pointer in parse_ct_limit_zones().
Command with empty string following "dpctl/ct-get-limits zone=" such as "ovs-appctl dpctl/ct-get-limits zone=" will cause parse_ct_limit_zones() dereferencing null. Signed-off-by: Zhiqi Chen <chenzhiqi.123@bytedance.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/dpctl.at16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/dpctl.at b/tests/dpctl.at
index 7454a51ec..d2f1046f8 100644
--- a/tests/dpctl.at
+++ b/tests/dpctl.at
@@ -135,3 +135,19 @@ AT_CHECK([ovs-appctl dpctl/dump-flows dummy@br0 | sort], [0], [dnl
AT_CHECK([ovs-appctl dpctl/del-dp dummy@br0])
OVS_VSWITCHD_STOP
AT_CLEANUP
+
+AT_SETUP([dpctl - ct-get-limits ct-del-limits])
+OVS_VSWITCHD_START
+AT_CHECK([ovs-appctl dpctl/ct-get-limits], [0], [default limit=0
+])
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=], [0], [default limit=0
+])
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=,], [0], [default limit=0
+])
+AT_CHECK([ovs-appctl dpctl/ct-get-limits zone=x], [2], [],
+ [ovs-vswitchd: invalid zone (Invalid argument)
+ovs-appctl: ovs-vswitchd: server returned an error
+])
+AT_CHECK([ovs-appctl dpctl/ct-del-limits zone=])
+OVS_VSWITCHD_STOP
+AT_CLEANUP \ No newline at end of file