to encrypt a message src->from is mandatory sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 11:59:45 +0200
branchsync
changeset 3079010b851a6262
parent 3078 c9dcf8aa1a08
child 3080 16fe89d2bc89
to encrypt a message src->from is mandatory
src/message_api.c
     1.1 --- a/src/message_api.c	Sun Oct 21 11:56:22 2018 +0200
     1.2 +++ b/src/message_api.c	Sun Oct 21 11:59:45 2018 +0200
     1.3 @@ -1621,10 +1621,10 @@
     1.4      bool added_key_to_real_src = false;
     1.5      
     1.6      assert(session);
     1.7 -    assert(src);
     1.8 +    assert(src && src->from);
     1.9      assert(dst);
    1.10  
    1.11 -    if (!(session && src && dst))
    1.12 +    if (!(session && src && src->from && dst))
    1.13          return PEP_ILLEGAL_VALUE;
    1.14  
    1.15      if (src->dir == PEP_dir_incoming)
    1.16 @@ -1639,7 +1639,7 @@
    1.17      
    1.18      *dst = NULL;
    1.19  
    1.20 -    if (src->from && (!src->from->user_id || src->from->user_id[0] == '\0')) {
    1.21 +    if (!src->from->user_id || src->from->user_id[0] == '\0') {
    1.22          char* own_id = NULL;
    1.23          status = get_default_own_userid(session, &own_id);
    1.24          if (own_id) {