Compare commits

..

1 Commits

Author SHA1 Message Date
4ef3bc8e46 Add low-impact warning flags, fix warnings found by new flags
All checks were successful
CI Code / Check spelling (pull_request) Successful in 16s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Code Coverage (pull_request) Successful in 4m48s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m20s
CI Code / Linux (debian) (pull_request) Successful in 6m22s
CI Code / Linux (arch) (pull_request) Successful in 11m47s
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)
2026-03-04 22:28:16 +03:00

View File

@@ -168,21 +168,21 @@ log_database_init(ProfAccount* account)
// replaces_db_id is ID (primary key) of the original message that LMC message corrects/replaces
// replaced_by_db_id is ID (primary key) of the last correcting (LMC) message for the original message
const char* query = "CREATE TABLE IF NOT EXISTS `ChatLogs` ("
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, "
"`from_jid` TEXT NOT NULL, "
"`to_jid` TEXT NOT NULL, "
"`from_resource` TEXT, "
"`to_resource` TEXT, "
"`message` TEXT, "
"`timestamp` TEXT, "
"`type` TEXT, "
"`stanza_id` TEXT, "
"`archive_id` TEXT, "
"`encryption` TEXT, "
"`marked_read` INTEGER, "
"`replace_id` TEXT, "
"`replaces_db_id` INTEGER, "
"`replaced_by_db_id` INTEGER)";
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, "
"`from_jid` TEXT NOT NULL, "
"`to_jid` TEXT NOT NULL, "
"`from_resource` TEXT, "
"`to_resource` TEXT, "
"`message` TEXT, "
"`timestamp` TEXT, "
"`type` TEXT, "
"`stanza_id` TEXT, "
"`archive_id` TEXT, "
"`encryption` TEXT, "
"`marked_read` INTEGER, "
"`replace_id` TEXT, "
"`replaces_db_id` INTEGER, "
"`replaced_by_db_id` INTEGER)";
if (SQLITE_OK != sqlite3_exec(g_chatlog_database, query, NULL, 0, &err_msg)) {
goto out;
}