diff options
author | lovetox <philipp@hoerist.com> | 2020-04-11 17:08:56 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-04-11 17:08:56 +0300 |
commit | 852b29d8be3816ea8dbf8c54e84dd184d5f10066 (patch) | |
tree | da958628716bd7a6bd779f665f2e368400b16acb | |
parent | d8b35aca9095e7a3d6b43c0991e982baf9530259 (diff) |
MAM: Check for first and last element in IQ result
-rw-r--r-- | nbxmpp/modules/mam.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nbxmpp/modules/mam.py b/nbxmpp/modules/mam.py index 0dd7528..b65c82c 100644 --- a/nbxmpp/modules/mam.py +++ b/nbxmpp/modules/mam.py @@ -119,6 +119,12 @@ class MAM(BaseModule): 'rsm set missing') complete = fin.getAttr('complete') == 'true' + if not complete: + if rsm.first is None or rsm.last is None: + return raise_error(self._log.warning, + stanza, + 'stanza-malformed', + 'missing first or last element') return MAMQueryData(jid=jid, complete=complete, |