# HG changeset patch # User Emmanuel Gil Peyrot # Date 1518859939 -3600 # Thu Feb 1 17:29:41 2018 +0100 # Node ID 8fe60cce419244a8265a24c981d359865ef301c7 # Parent a966a21836e807f718740404a0e9220051ceed93 util.stanza: Fix the #981 infinite loop in stanza:maptags(). diff -r c63db78f4ae0 util/stanza.lua --- a/util/stanza.lua Sat Sep 09 14:45:23 2017 +0100 +++ b/util/stanza.lua Thu Feb 01 17:29:01 2018 +0100 @@ -157,7 +157,7 @@ local n_children, n_tags = #self, #tags; local i = 1; - while curr_tag <= n_tags and n_tags > 0 do + while curr_tag <= n_tags and n_tags > 0 and i < n_children do if self[i] == tags[curr_tag] then local ret = callback(self[i]); if ret == nil then