1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-27 20:30:13 -04:00
Commit Graph

3960 Commits

Author SHA1 Message Date
Michael Vetter
dacbe25d93 Remove duplicate code in roster_update
Part of what `roster_update()` does manually is actually done in
`roster_change_name()`.
2019-08-23 09:50:53 +02:00
Michael Vetter
13088e0a1a Use fixed email instead of PACKAGE_BUGREPORT 2019-08-23 09:40:54 +02:00
Holger Weiß
3228ab47d3 Don't render (all) delayed messages as MUC history
Double-check that a <delay/> tag on a groupchat message was actually
added by the MUC service (rather than the sending client) before
assuming it was received from the MUC history.

Fixes #1173.
2019-08-20 17:51:26 +02:00
Michael Vetter
d8d6aa4b88
Merge pull request #1167 from profanity-im/feature/specify-config-file
Possibility to specify alternative config file
2019-08-02 16:22:12 +02:00
Michael Vetter
10ca3e8c31 Possibility to specify alternative config file
Introduce `profanity -c` to specify an alternative config file.
2019-08-02 15:55:47 +02:00
Michael Vetter
25501a5d8a Improve sv_ev_roster_received() last activity check
We don't need to do all the timing stuff if last activity is disabled
anyways.
2019-08-02 15:52:49 +02:00
Michael Vetter
5d711639b0
Merge pull request #1166 from profanity-im/fix/1165-subscribed-msg
Don't print subscribed message if contact is already in roster
2019-08-02 12:48:01 +02:00
Michael Vetter
658e36a066 Add 'save' command to save preferences
Most applications have an 'apply changes' button. This makes testing
easier too.

Implement https://github.com/profanity-im/profanity/issues/1164
2019-08-02 10:23:13 +02:00
Michael Vetter
53c3115976 Don't print subscribed message if contact is already in roster
This occured with a user running Cisco Jabber. It seems this server
sends repeated presence subscribed stanzas. And although I find this
strange according to RFC this seems to be ok.

So let's filter them and only display in the console output and to the
log. But don't open seperate windows.

Fix https://github.com/profanity-im/profanity/issues/1165
2019-08-01 20:48:23 +02:00
Michael Vetter
ad0a1efd8c
Merge pull request #1163 from paulfariello/hotfix/command-exec
Fix memleak in /cmd exec
2019-07-30 13:50:25 +02:00
Paul Fariello
b3e59e1fb6 Fix memleak in /cmd exec 2019-07-30 13:35:08 +02:00
Michael Vetter
1ec87ffd8f
Merge pull request #1161 from profanity-im/fix/omemo-leak
Fix memleaks in OMEMO
2019-07-30 11:22:41 +02:00
Paul Fariello
5e61bc08dd Fix command form submit
Command form userdata were freed by iq_id_handler.
We should now free the command ourself.
2019-07-30 10:22:57 +02:00
Michael Vetter
1b2e71faac Fix memleak in save_identity()
I don't see a reason for strdupping here.
2019-07-23 08:34:46 +02:00
Michael Vetter
a9db705faa Fix potential leak in omemo_untrust() 2019-07-23 08:34:46 +02:00
Michael Vetter
fade378fee Dont use not needed strdup() in save_identity()
I don't see a reason for strdupping here.
2019-07-23 08:34:46 +02:00
Michael Vetter
bb08c7270d Make sure result is always set for otr_get_policy() 2019-07-23 08:03:39 +02:00
Michael Vetter
41bf7f4b22
Merge pull request #1160 from profanity-im/fix/1159-groupaddsegfault
Fix segfault in group add/remove command
2019-07-22 20:16:27 +02:00
Michael Vetter
9f0a40819f Fix memleak in roster_change_name() 2019-07-22 15:37:41 +02:00
Michael Vetter
41b54a5c14 Fix 3 leaks in cmd_funcs 2019-07-22 15:26:32 +02:00
Michael Vetter
27952cb16c Fix several memleaks im cmd_ac.c
Exiting without freeing in some cases.
2019-07-22 14:59:20 +02:00
Michael Vetter
46ddf2c2f4 Fix memleak in roster_remove
strdup() is not needed here but will actually lead to a memleak.
2019-07-22 14:47:45 +02:00
Michael Vetter
41267ae1c5 Fix memory leak in roster_update()
current_name should not be const and should be freed.
2019-07-22 14:42:43 +02:00
Michael Vetter
e540ccd50e Remove dead assignments 2019-07-22 14:27:14 +02:00
Michael Vetter
137d128af2 Remove unused assignments 2019-07-22 14:16:10 +02:00
Michael Vetter
e75cc41164 Fix double initialization of loop iterator 2019-07-22 14:02:33 +02:00
Michael Vetter
16174727f4 Guard against arg being NULL in cmd_funcs
This should actually never happen because we have the mechanism that
checks the commands. But let's do it in case we break something in that
mechanism and to make clang happy.

Fixes clangs: 'Argument with 'nonnull' attribute passed null'
2019-07-22 13:47:52 +02:00
Michael Vetter
d004891a29 Reduce scope of num in ui_print_system_msg_from_recipient() 2019-07-22 13:25:52 +02:00
Michael Vetter
fa27ab9561 Fix segfault in group add/remove command
Also regarding destructor.
Fix https://github.com/profanity-im/profanity/issues/1159
2019-07-22 11:54:05 +02:00
Michael Vetter
4a0fa1cf9e
Merge pull request #1154 from optmzr/issue-1099
Always check for directory changes with sendfile auto completion
2019-07-20 19:36:59 +02:00
William Wennerström
0c10a699f2
Always check for directory changes with sendfile auto completion
Instead of only checking for files when 'last_directory' has changed, do
it every time.

Add autocomplete_update function that updates the items while retaining
last_found and search_str.

Fixes #1099
2019-07-20 10:38:22 +02:00
Michael Vetter
d3828cf24e Fix segfault in block command
Another case of double free() due to new destructor.

Fixes https://github.com/profanity-im/profanity/issues/1156
2019-07-19 12:38:33 +02:00
Michael Vetter
c07d533ec1 Fixup for last commit 2019-07-12 11:11:45 +02:00
Michael Vetter
68b6deefbf Fix segfault in iq_{submit,cancel}_command_config
Taken care of by the destructor.
2019-07-12 10:57:07 +02:00
Michael Vetter
04988ab4ba Fix segfault in /cmd exec
Test for correct number of arguments before using argument.
2019-07-12 10:36:17 +02:00
Michael Vetter
ad41959cc6
Merge pull request #1150 from paulfariello/hotfix/omemo-memleaks
Hotfix/omemo memleaks

Regards https://github.com/profanity-im/profanity/issues/1131
2019-07-11 16:19:31 +02:00
Michael Vetter
f32827d70d Fix some more potential double frees
Regards https://github.com/profanity-im/profanity/issues/1148
2019-07-11 16:15:57 +02:00
Paul Fariello
c22df13d95 Dirty fix libgcrypt memleak 2019-07-11 14:25:42 +02:00
Paul Fariello
b7144d82fe Enable secure memory in gcrypt initialisation 2019-07-11 11:01:07 +02:00
Paul Fariello
b110da9a92 Fix various OMEMO memleaks 2019-07-10 17:32:23 +02:00
Michael Vetter
eb14ae5f03 Fix jump depending on uninit. value in statusbar 2019-07-10 12:55:49 +02:00
Michael Vetter
6c8e567328 Reduce codelines in form.c
Let's use calloc instead of malloc and then setting almost all fields to
NULL.
2019-07-10 12:53:45 +02:00
Michael Vetter
a8b3de7016 Fix double free in roster_process_pending_presence
This is taken care of now in the destructor _pendingPresence_free().
2019-07-10 12:08:09 +02:00
Michael Vetter
38edc1c325 Add destructor for roster_pending_presence
Fix:
```
==18682== 408 bytes in 17 blocks are definitely lost in loss record
3,279 of 3,632
==18682==    at 0x483677F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18682==    by 0x42F602: roster_update_presence (roster_list.c:129)
==18682==    by 0x448AA3: sv_ev_contact_online (server_events.c:906)
==18682==    by 0x43D2BA: _available_handler (presence.c:674)
==18682==    by 0x43C81B: _presence_handler (presence.c:398)
==18682==    by 0x5AF118E: handler_fire_stanza (handler.c:124)
==18682==    by 0x5AEDBDA: _handle_stream_stanza (conn.c:1253)
==18682==    by 0x5AFA43E: _end_element (parser_expat.c:190)
==18682==    by 0x6818AA4: doContent (xmlparse.c:2977)
==18682==    by 0x681A3AB: contentProcessor (xmlparse.c:2552)
==18682==    by 0x681D7EB: XML_ParseBuffer (xmlparse.c:1988)
==18682==    by 0x681D7EB: XML_ParseBuffer (xmlparse.c:1957)
==18682==    by 0x5AF0A63: xmpp_run_once (event.c:255)
==18682==    by 0x432E5D: connection_check_events (connection.c:104)
==18682==    by 0x4323B3: session_process_events (session.c:255)
==18682==    by 0x42C097: prof_run (profanity.c:128)
==18682==    by 0x4B25B9: main (main.c:172)
```
2019-07-09 16:04:27 +02:00
Michael Vetter
89d8fc846e Fix double free in room id handler
Free is done in destructor now.
Regards https://github.com/profanity-im/profanity/issues/1148
2019-07-09 09:47:35 +02:00
Michael Vetter
7af85d0fe0 Fix double free in omemo_start_device_session_handle_bundle()
omemo_key_free() was called to free the key.
It free the key->data too. But in same cases this was not set  yet. So
we need to set the data to NULL (or use calloc) at initialization so
that omemo_key_free() only frees it if it was actually allocated.

Regards https://github.com/profanity-im/profanity/issues/1148
2019-07-08 16:36:05 +02:00
Michael Vetter
b3bb62dcbd Fix double free regarding iq handlers 2019-07-08 15:58:40 +02:00
Michael Vetter
6355272091
Merge pull request #1146 from profanity-im/fix/omemoleaks-autocompl
Fix several OMEMO related leaks
2019-07-04 18:01:59 +02:00
Michael Vetter
9aad2aa487 Free iq_id_handlers correctly
so far only the key part was freed. We also need to free the actual
handler.

Fix:
```
==21171== 1,128 bytes in 47 blocks are definitely lost in loss record
3,476 of 3,670
==21171==    at 0x483677F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21171==    by 0x434248: iq_id_handler_add (iq.c:265)
==21171==    by 0x4B122E: omemo_devicelist_request (omemo.c:46)
==21171==    by 0x4AC411: omemo_start_session (omemo.c:409)
==21171==    by 0x4AC37C: omemo_start_sessions (omemo.c:396)
==21171==    by 0x447881: sv_ev_roster_received (server_events.c:189)
==21171==    by 0x444019: roster_result_handler (roster.c:312)
==21171==    by 0x433FC2: _iq_handler (iq.c:202)
==21171==    by 0x5AF118E: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x5AEDBDA: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x5AFA43E: ??? (in /usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x6818AA4: ??? (in /usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x681A3AB: ??? (in /usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x681D7EB: XML_ParseBuffer (in
/usr/lib64/libexpat.so.1.6.8)
==21171==    by 0x5AF0A63: xmpp_run_once (in
/usr/lib64/libmesode.so.0.0.0)
==21171==    by 0x432E5D: connection_check_events (connection.c:104)
==21171==    by 0x4323B3: session_process_events (session.c:255)
==21171==    by 0x42C097: prof_run (profanity.c:128)
==21171==    by 0x4B2627: main (main.c:172)
```
2019-07-04 14:25:53 +02:00
Paul Fariello
c0e8f72276 Fix plaintext private message handling 2019-07-04 14:02:42 +02:00