src/mime.c
changeset 191 3bb51ee8f90d
parent 160 ca9b52c362cb
child 248 49010f5b2346
     1.1 --- a/src/mime.c	Wed Apr 15 12:31:08 2015 +0200
     1.2 +++ b/src/mime.c	Wed Apr 15 12:53:50 2015 +0200
     1.3 @@ -771,6 +771,9 @@
     1.4      assert(msg->mime == PEP_MIME_none);
     1.5      assert(mimetext);
     1.6  
     1.7 +    if (!(msg && msg->mime == PEP_MIME_none && mimetext))
     1.8 +        return PEP_ILLEGAL_VALUE;
     1.9 +
    1.10      *mimetext = NULL;
    1.11  
    1.12      switch (msg->enc_format) {
    1.13 @@ -1423,6 +1426,9 @@
    1.14      assert(mimetext);
    1.15      assert(msg);
    1.16  
    1.17 +    if (!(mimetext && msg))
    1.18 +        return PEP_ILLEGAL_VALUE;
    1.19 +
    1.20      *msg = NULL;
    1.21  
    1.22      index = 0;