mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 05:46:20 +00:00
fix(cmd_caps): Prevent crash in /caps with malformed JID input
- Added null check for `jid` in `cmd_caps` to handle `jid_create` returning NULL. - Crash occurred when processing malformed inputs like `@example.com` in `/caps`. - Ensures robust handling of invalid JID strings in `WIN_CHAT` and `WIN_CONSOLE` cases. Fixes #20
This commit is contained in:
@@ -3418,7 +3418,7 @@ cmd_caps(ProfWin* window, const char* const command, gchar** args)
|
||||
if (args[0]) {
|
||||
auto_jid Jid* jid = jid_create(args[0]);
|
||||
|
||||
if (jid->fulljid == NULL) {
|
||||
if (jid == NULL || jid->fulljid == NULL) {
|
||||
cons_show("You must provide a full jid to the /caps command.");
|
||||
} else {
|
||||
PContact pcontact = roster_get_contact(jid->barejid);
|
||||
|
||||
Reference in New Issue
Block a user