diff options
author | defanor <defanor@uberspace.net> | 2021-12-28 09:47:44 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2021-12-28 09:47:44 +0300 |
commit | e815865399bd6c72cff74c7ca485d40abacc693e (patch) | |
tree | 3e5504792df9ff1e7b2cbac89e85bbe1570f530e /src | |
parent | 930eb88b585afb4ee8faf3b26b435e6995a681ee (diff) |
Fix integer overflow on stanzas_out_acknowledged > stanzas_out_count
Diffstat (limited to 'src')
-rw-r--r-- | src/rexmpp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c index f041765..d7e1364 100644 --- a/src/rexmpp.c +++ b/src/rexmpp.c @@ -1142,8 +1142,8 @@ rexmpp_err_t rexmpp_send (rexmpp_t *s, xmlNodePtr node) if (rexmpp_xml_is_stanza(node)) { if (s->sm_state == REXMPP_SM_ACTIVE) { - if (s->stanzas_out_count - s->stanzas_out_acknowledged >= - s->stanza_queue_size) { + if (s->stanzas_out_count >= + s->stanza_queue_size + s->stanzas_out_acknowledged) { xmlFreeNode(node); rexmpp_log(s, LOG_ERR, "The stanza queue is full, not sending."); return REXMPP_E_STANZA_QUEUE_FULL; |