free_message(dst) is UB when decrypt_message() fails before dst is set to a valid value. free_message(NULL) is well-defined.
authorRoker <roker@pep-project.org>
Tue, 24 Jan 2017 08:24:36 +0100
changeset 1554a62835de9daf
parent 1553 e2d7706e2ff5
child 1555 7ffa6cf9d054
free_message(dst) is UB when decrypt_message() fails before dst is set to a valid value. free_message(NULL) is well-defined.
src/message_api.c
     1.1 --- a/src/message_api.c	Mon Jan 23 22:48:20 2017 +0100
     1.2 +++ b/src/message_api.c	Tue Jan 24 08:24:36 2017 +0100
     1.3 @@ -2388,7 +2388,7 @@
     1.4      if (keylist == NULL) {
     1.5  
     1.6          // Message is to be decrypted
     1.7 -        message *dst;
     1.8 +        message *dst = NULL;
     1.9          stringlist_t *_keylist = keylist;
    1.10          PEP_rating rating;
    1.11          PEP_decrypt_flags_t flags;