mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 09:36:21 +00:00
Add low-impact warning flags, fix warnings found by new flags
Add compiler flags: -Wundef, -Wfloat-equal, -Wredundant-decls, -Walloc-zero. Fix -Wredundant-decls warnings: - Remove stale cons_show_desktop_prefs declaration (ui.h) - Remove duplicate connection_set_priority prototype (connection.h) - Remove stale omemo_devicelist_configure_and_request declaration (omemo.h) Fix potential buffer overflow in stanza.c: - Increase pri_str and idle_str buffers from 10 to 12 bytes (INT_MIN = -2147483648 needs 12 bytes including NUL)
This commit is contained in:
@@ -1948,7 +1948,7 @@ stanza_attach_priority(xmpp_ctx_t* const ctx, xmpp_stanza_t* const presence, con
|
||||
return;
|
||||
}
|
||||
|
||||
char pri_str[10];
|
||||
char pri_str[12];
|
||||
snprintf(pri_str, sizeof(pri_str), "%d", pri);
|
||||
|
||||
xmpp_stanza_t* priority = xmpp_stanza_new(ctx);
|
||||
@@ -2007,7 +2007,7 @@ stanza_attach_last_activity(xmpp_ctx_t* const ctx,
|
||||
xmpp_stanza_t* query = xmpp_stanza_new(ctx);
|
||||
xmpp_stanza_set_name(query, STANZA_NAME_QUERY);
|
||||
xmpp_stanza_set_ns(query, STANZA_NS_LASTACTIVITY);
|
||||
char idle_str[10];
|
||||
char idle_str[12];
|
||||
snprintf(idle_str, sizeof(idle_str), "%d", idle);
|
||||
xmpp_stanza_set_attribute(query, STANZA_ATTR_SECONDS, idle_str);
|
||||
xmpp_stanza_add_child(presence, query);
|
||||
|
||||
Reference in New Issue
Block a user