Software /
code /
prosody-modules
Diff
mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 2814:1ffbd73c54ba
mod_storage_xmlarchive: Add a sanity check to prevent reading from internal storage archives
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 09 Nov 2017 13:41:36 +0100 |
parent | 2813:e5ce64aee4ac |
child | 2815:d48d4d9ccae7 |
line wrap: on
line diff
--- 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 = {};