Browse Source

This fixes a problem where non-existent domains could cause the lua script to fail which would then leave the database connection open and eventually lead to denial of service when the database runs out of connections. Everyone using xml handler needs this update.

Mark Crane 12 năm trước cách đây
mục cha
commit
a8d6112db3

+ 5 - 0
includes/install/scripts/app/xml_handler/resources/scripts/directory/directory.lua

@@ -85,6 +85,11 @@
 				continue = false;
 			end
 
+		--prevent processing for invalid domains
+			if (domain_uuid == nil) then
+				continue = false;
+			end
+
 		--get the extension from the database
 			if (continue) then
 				sql = "SELECT * FROM v_extensions WHERE domain_uuid = '" .. domain_uuid .. "' and extension = '" .. user .. "' and enabled = 'true' ";