this is necessary, looks like the one in pgp_sequoia is not working, but it's correct to do it here anyway sync
authorVolker Birk <vb@pep-project.org>
Wed, 15 May 2019 14:22:27 +0200
branchsync
changeset 36855d371faa8423
parent 3683 c6914bf63ee4
child 3686 7dbf0a0f6163
this is necessary, looks like the one in pgp_sequoia is not working, but it's correct to do it here anyway
src/message_api.c
     1.1 --- a/src/message_api.c	Wed May 15 14:03:15 2019 +0200
     1.2 +++ b/src/message_api.c	Wed May 15 14:22:27 2019 +0200
     1.3 @@ -993,7 +993,13 @@
     1.4              return PEP_OUT_OF_MEMORY;
     1.5      }
     1.6  
     1.7 -    dst->longmsg = ctext;
     1.8 +    char *_ctext = realloc(ctext, csize + 1);
     1.9 +    assert(_ctext);
    1.10 +    if (!_ctext)
    1.11 +        return PEP_OUT_OF_MEMORY;
    1.12 +    _ctext[csize] = 0;
    1.13 +
    1.14 +    dst->longmsg = _ctext;
    1.15      return PEP_STATUS_OK;
    1.16  }
    1.17