Fixed double free and unprotected NULL dereferencing.
authorEdouard Tisserant
Sat, 10 Oct 2015 17:24:45 +0200
changeset 3712b34176e3fd7
parent 370 e64de95cd36c
child 372 3fb0f63d566e
Fixed double free and unprotected NULL dereferencing.
build-android/build.sh
src/keymanagement.c
src/message_api.c
     1.1 --- a/build-android/build.sh	Sat Oct 10 17:17:57 2015 +0200
     1.2 +++ b/build-android/build.sh	Sat Oct 10 17:24:45 2015 +0200
     1.3 @@ -7,7 +7,8 @@
     1.4  openssl_build_version=1
     1.5  cyrus_sasl_build_version=1
     1.6  libetpan_build_version=1
     1.7 -archs="armeabi armeabi-v7a x86 x86_64"
     1.8 +# archs="armeabi armeabi-v7a x86 x86_64"
     1.9 +archs="armeabi"
    1.10  package_name=pEpEngine-android
    1.11  
    1.12  current_dir="`pwd`"
     2.1 --- a/src/keymanagement.c	Sat Oct 10 17:17:57 2015 +0200
     2.2 +++ b/src/keymanagement.c	Sat Oct 10 17:24:45 2015 +0200
     2.3 @@ -235,7 +235,10 @@
     2.4          if (status == PEP_OUT_OF_MEMORY)
     2.5              return PEP_OUT_OF_MEMORY;
     2.6  
     2.7 -        assert(keylist);
     2.8 +        assert(keylist || keylist->value);
     2.9 +        if (keylist == NULL || keylist->value == NULL) {
    2.10 +            return PEP_UNKNOWN_ERROR;
    2.11 +        }
    2.12      }
    2.13      else {
    2.14          bool expired;
     3.1 --- a/src/message_api.c	Sat Oct 10 17:17:57 2015 +0200
     3.2 +++ b/src/message_api.c	Sat Oct 10 17:24:45 2015 +0200
     3.3 @@ -327,8 +327,10 @@
     3.4      _src->enc_format = PEP_enc_none;
     3.5      status = mime_encode_message(_src, true, &mimetext);
     3.6      assert(status == PEP_STATUS_OK);
     3.7 -    if (free_ptext)
     3.8 +    if (free_ptext){
     3.9          free(ptext);
    3.10 +        free_ptext=0;
    3.11 +    }
    3.12      free(_src);
    3.13      assert(mimetext);
    3.14      if (mimetext == NULL)