Changeset

5233:7eec2bc67c26

mod_firewall: Warn about invalid pubsubitemid list specification
author Matthew Wild <mwild1@gmail.com>
date Sat, 11 Mar 2023 16:40:24 +0000
parents 5232:0f943619e01a
children 5234:f6c71d9d6dc0
files mod_firewall/definitions.lib.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/definitions.lib.lua	Sat Mar 11 16:40:09 2023 +0000
+++ b/mod_firewall/definitions.lib.lua	Sat Mar 11 16:40:24 2023 +0000
@@ -198,6 +198,10 @@
 	pubsubitemid = {
 		init = function(self, pubsub_spec, opts)
 			local service_addr, node = pubsub_spec:match("^pubsubitemid:([^/]*)/(.*)");
+			if not service_addr then
+				module:log("warn", "Invalid list specification (expected 'pubsubitemid:<service>/<node>', got: '%s')", pubsub_spec);
+				return;
+			end
 			module:depends("pubsub_subscription");
 			module:add_item("pubsub-subscription", {
 					service = service_addr;