XEP-0030: Empty disco#items result silently ignored #90

Closed
opened 2026-02-10 22:26:13 +00:00 by jabber.developer2 · 1 comment
Collaborator

Description

When querying service discovery items (/disco items) on a server that returns an empty <query/> element (no items), the client silently ignores the result instead of displaying a message to the user.

Expected Behavior

Display message: No service discovery items for <jid>

Actual Behavior

No output shown to user. Command appears to do nothing.

Steps to Reproduce

  1. Connect to any XMPP server
  2. Run /disco items against a JID that has no associated items
  3. Observe no response

XEP-0030 Reference

Per XEP-0030 Section 3, 4:

"If there are no items associated with an entity (or if those items are not publicly available), the target entity MUST return an empty query element to the requesting entity"

Example valid response:

<iq type='result' from='example.com' to='user@example.com/resource' id='items1'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

Root Cause

In iq.c, function _disco_items_result_handler() has early return when query has no children:

xmpp_stanza_t* child = xmpp_stanza_get_children(query);
if (child == NULL) {
    return;  // <-- Bug: exits before showing "No items" message
}

Introduced In

Commit f28655c5c (2016-05-08) "Move logic to connection_set_disco_items"

Affected Versions

All versions since 0.5.0

Proposed Fix

Remove the early return check. PR #89 submitted.

### Description When querying service discovery items (`/disco items`) on a server that returns an empty `<query/>` element (no items), the client silently ignores the result instead of displaying a message to the user. ### Expected Behavior Display message: `No service discovery items for <jid>` ### Actual Behavior No output shown to user. Command appears to do nothing. ### Steps to Reproduce 1. Connect to any XMPP server 2. Run `/disco items` against a JID that has no associated items 3. Observe no response ### XEP-0030 Reference Per [XEP-0030 Section 3, 4](https://xmpp.org/extensions/xep-0030.html#items): > "If there are no items associated with an entity (or if those items are not publicly available), the target entity MUST return an empty query element to the requesting entity" Example valid response: ```xml <iq type='result' from='example.com' to='user@example.com/resource' id='items1'> <query xmlns='http://jabber.org/protocol/disco#items'/> </iq> ``` ### Root Cause In iq.c, function `_disco_items_result_handler()` has early return when query has no children: ```c xmpp_stanza_t* child = xmpp_stanza_get_children(query); if (child == NULL) { return; // <-- Bug: exits before showing "No items" message } ``` ### Introduced In Commit f28655c5c (2016-05-08) "Move logic to connection_set_disco_items" ### Affected Versions All versions since 0.5.0 ### Proposed Fix Remove the early return check. PR #89 submitted.
jabber.developer2 added the
Kind/Bug
label 2026-02-10 22:26:14 +00:00
jabber.developer2 added this to the Plans (2025-2026) project 2026-02-10 22:26:17 +00:00

Resolved by #89

Resolved by #89
jabber.developer moved this to Done in Plans (2025-2026) on 2026-02-11 08:43:01 +00:00
jabber.developer moved this to Verification in Plans (2025-2026) on 2026-02-11 08:43:26 +00:00
jabber.developer moved this to Done in Plans (2025-2026) on 2026-03-04 11:36:13 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: devs/cproof#90
No description provided.