# HG changeset patch # User Kim Alvefur # Date 1510231296 -3600 # Node ID 1ffbd73c54ba28d8294f918b440a20d0d6e5eaae # Parent e5ce64aee4ac181ce12b126b15b49605948a6d4d mod_storage_xmlarchive: Add a sanity check to prevent reading from internal storage archives diff -r e5ce64aee4ac -r 1ffbd73c54ba mod_storage_xmlarchive/mod_storage_xmlarchive.lua --- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Thu Nov 09 13:34:05 2017 +0100 +++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Thu Nov 09 13:41:36 2017 +0100 @@ -269,7 +269,11 @@ end function archive:dates(username) - return dm.list_load(username, self.host, self.store); + local dates, err = dm.list_load(username, self.host, self.store); + if not dates then return dates, err; end + assert(type(dates[1]) == "string" and type(dates[#dates]) == "string", + "Archive does not appear to be in xmlarchive format"); + return dates; end local provider = {};