Crash in /caps Command with Malformed JID Input #20

Closed
opened 2025-09-01 19:28:10 +00:00 by jabber.developer · 0 comments

Problem:
The /caps command crashes when provided with malformed JID inputs like @example.com in WIN_CHAT or WIN_CONSOLE modes. The issue occurs because jid_create may return a NULL pointer for invalid inputs, but cmd_caps only checks jid->fulljid for null, leading to a potential null pointer dereference.

Proposed solution:
Add null checks for the jid pointer in cmd_caps and ensure consistent handling in the WIN_MUC case. Include unit tests to verify robust handling of malformed inputs.

**Problem:** The `/caps` command crashes when provided with malformed JID inputs like `@example.com` in `WIN_CHAT` or `WIN_CONSOLE` modes. The issue occurs because `jid_create` may return a `NULL` pointer for invalid inputs, but `cmd_caps` only checks `jid->fulljid` for null, leading to a potential null pointer dereference. **Proposed solution:** Add null checks for the `jid` pointer in `cmd_caps` and ensure consistent handling in the `WIN_MUC` case. Include unit tests to verify robust handling of malformed inputs.
admin closed this issue 2025-09-01 19:48:27 +00:00
jabber.developer self-assigned this 2025-09-01 22:23:52 +00:00
jabber.developer added the
Kind/Bug
label 2025-09-01 22:24:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: devs/cproof#20
No description provided.