Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGABRT when using wrong argument order for receiving ox key. #1698

Closed
mdosch opened this issue Apr 27, 2022 · 0 comments · Fixed by #1699
Closed

SIGABRT when using wrong argument order for receiving ox key. #1698

mdosch opened this issue Apr 27, 2022 · 0 comments · Fixed by #1699
Assignees
Labels
Milestone

Comments

@mdosch
Copy link
Contributor

mdosch commented Apr 27, 2022

If you doy /ox receive fingerprint jid instead of /ox receive jid fingerprint profanity aborts.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
49	../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt full
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
        set = {__val = {0, 140737341865590, 93827783032832, 93825182977792, 93825182977893, 93825182977792, 93825182977792, 93825182977914, 93825182978092, 93825182977792, 93825182978092, 0, 0, 0, 0, 0}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
#1  0x00007ffff73f5546 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x555560b3bc40, sa_sigaction = 0x555560b3bc40}, sa_mask = {__val = {0, 7, 93825182977792, 0, 0, 0, 17123950309835342848, 140733193388034, 18446744073709551488, 0, 93824993148768, 343, 
              93824993149280, 0, 140737341921716, 140737343251744}}, sa_flags = -146526302, sa_restorer = 0x555555634540 <__PRETTY_FUNCTION__.0>}
        sigs = {__val = {32, 0, 140737323436608, 140737341826469, 0, 140737341713606, 93824993150272, 140737319675220, 93824993148768, 140737341826790, 206158430232, 140737488346432, 140737488346240, 17123950309835342848, 93824993148768, 
            343}}
#2  0x00007ffff73f542f in __assert_fail_base (fmt=0x7ffff5f22554 "%s%s%s:%u: %s%sZusicherung »%s« nicht erfüllt.\n%n", assertion=0x555555634160 "strlen(fingerprint) == KEYID_LENGTH", file=0x555555633f60 "src/xmpp/ox.c", line=343, 
    function=<optimized out>) at assert.c:92
        str = 0x555560b3bc40 "\333?\033\065PU"
        total = 4096
#3  0x00007ffff7404222 in __GI___assert_fail (assertion=0x555555634160 "strlen(fingerprint) == KEYID_LENGTH", file=0x555555633f60 "src/xmpp/ox.c", line=343, function=0x555555634540 <__PRETTY_FUNCTION__.0> "_ox_request_public_key")
    at assert.c:101
No locals.
#4  0x00005555555b1c67 in _ox_request_public_key (jid=0x555560b3a9c0 "F64D105DF8414BC0ABA2E1A945D3D85C5CAF8947", fingerprint=0x555558990dd0 "schlepptop@mdosch.de") at src/xmpp/ox.c:343
        __PRETTY_FUNCTION__ = "_ox_request_public_key"
        ctx = 0x0
        id = 0x0
        iq = 0x555555589560 <_start>
        pubsub = 0x7fffffffded0
        node_name = 0x555560b3a840
        items = 0x0
#5  0x00005555555b16f4 in ox_request_public_key (jid=0x555560b3a9c0 "F64D105DF8414BC0ABA2E1A945D3D85C5CAF8947", fingerprint=0x555558990dd0 "schlepptop@mdosch.de") at src/xmpp/ox.c:201
No locals.
#6  0x00005555555f1e99 in cmd_ox (window=0x555555784e40, command=0x5555604d9860 "/ox", args=0x555560b3a830) at src/command/cmd_funcs.c:7698
        __PRETTY_FUNCTION__ = "cmd_ox"
#7  0x00005555555f36ae in _cmd_execute (window=0x555555784e40, command=0x5555604d9860 "/ox", inp=0x55555909d760 "/ox request F64D105DF8414BC0ABA2E1A945D3D85C5CAF8947 schlepptop@mdosch.de") at src/command/cmd_funcs.c:8349
        args = 0x555560b3a830
        result = -8288
        cmd = 0x5555556c1280 <command_defs+216960>
        result = 1
#8  0x00005555555dc6ff in cmd_process_input (window=0x555555784e40, inp=0x55555909d760 "/ox request F64D105DF8414BC0ABA2E1A945D3D85C5CAF8947 schlepptop@mdosch.de") at src/command/cmd_funcs.c:212
        inp_cpy = 0x5555604d9860 "/ox"
        command = 0x5555604d9860 "/ox"
        question_mark = 0x0
        result = 0
#9  0x000055555558e529 in prof_run (log_level=0x55555565cb2f "WARN", account_name=0x0, config_file=0x0, log_file=0x0, theme_name=0x0) at src/profanity.c:119
        window = 0x555555784e40
        cont = 1
        line = 0x55555909d760 "/ox request F64D105DF8414BC0ABA2E1A945D3D85C5CAF8947 schlepptop@mdosch.de"
#10 0x000055555562d852 in main (argc=1, argv=0x7fffffffe178) at src/main.c:180
        entries = {{long_name = 0x55555565cb34 "version", short_name = 118 'v', flags = 0, arg = G_OPTION_ARG_NONE, arg_data = 0x5555556e64e0 <version>, description = 0x55555565cb3c "Show version information", arg_description = 0x0}, {
            long_name = 0x55555565cb55 "account", short_name = 97 'a', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e64f8 <account_name>, description = 0x55555565cb60 "Auto connect to an account on startup", 
            arg_description = 0x0}, {long_name = 0x55555565cb86 "log", short_name = 108 'l', flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e64e8 <log>, 
            description = 0x55555565cb90 "Set logging levels, DEBUG, INFO, WARN (default), ERROR", arg_description = 0x55555565cbc7 "LEVEL"}, {long_name = 0x55555565cbcd "config", short_name = 99 'c', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e6500 <config_file>, description = 0x55555565cbd8 "Use an alternative configuration file", arg_description = 0x0}, {long_name = 0x55555565cbfe "logfile", short_name = 102 'f', 
            flags = 0, arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e64f0 <log_file>, description = 0x55555565cc06 "Specify log file", arg_description = 0x0}, {long_name = 0x55555565cc17 "theme", short_name = 116 't', flags = 0, 
            arg = G_OPTION_ARG_STRING, arg_data = 0x5555556e6508 <theme_name>, description = 0x55555565cc1d "Specify theme name", arg_description = 0x0}, {long_name = 0x0, short_name = 0 '\000', flags = 0, arg = G_OPTION_ARG_NONE, 
            arg_data = 0x0, description = 0x0, arg_description = 0x0}}
        error = 0x0
        context = 0x55555570e9d0

Expected Behavior

No abort, but a warning about using the wrong syntax.

Current Behavior

abort

Environment

Debian Unstable

profanity -v                                      
Profanity, version 0.12.1dev.master.8ffd8079
Copyright (C) 2012 - 2019 James Booth <boothj5web@gmail.com>.
Copyright (C) 2019 - 2021 Michael Vetter <jubalh@iodoru.org>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.16.0-unknown)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Disabled
GTK icons/clipboard: Disabled
@mdosch mdosch changed the title Segfault when using wrong argument order for receiving ox key. SIGABRT when using wrong argument order for receiving ox key. Apr 27, 2022
@jubalh jubalh self-assigned this Apr 27, 2022
@jubalh jubalh added the bug label Apr 27, 2022
@jubalh jubalh added this to the 0.13.0 milestone Apr 27, 2022
jubalh added a commit that referenced this issue Apr 27, 2022
Asserting here is not the right thing to do at all.
A person could have a typo in the fingerprint. Or like in the case of
the reported bug just confuse the arguments.

An additional check for valid jid should be added later to the calling
function maybe.

Fix #1698
jubalh added a commit that referenced this issue Apr 27, 2022
Asserting here is not the right thing to do at all.
A person could have a typo in the fingerprint. Or like in the case of
the reported bug just confuse the arguments.

An additional check for valid jid should be added later to the calling
function maybe.

Fix #1698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants