deal with empty string for mime_type keysync
authorVolker Birk <vb@pep.foundation>
Tue, 16 Aug 2016 19:19:53 +0200
branchkeysync
changeset 1025484c6671be0f
parent 1016 3c97711fc15a
child 1026 ed301012d546
deal with empty string for mime_type
src/mime.c
     1.1 --- a/src/mime.c	Mon Aug 15 20:01:19 2016 +0200
     1.2 +++ b/src/mime.c	Tue Aug 16 19:19:53 2016 +0200
     1.3 @@ -253,13 +253,12 @@
     1.4      PEP_STATUS status = PEP_STATUS_OK;
     1.5      struct mailmime * mime = NULL;
     1.6      char * mime_type;
     1.7 -
     1.8      assert(blob);
     1.9      assert(result);
    1.10  
    1.11      *result = NULL;
    1.12  
    1.13 -    if (blob->mime_type == NULL)
    1.14 +    if (blob->mime_type == NULL || blob->mime_type[0] == 0)
    1.15          mime_type = "application/octet-stream";
    1.16      else
    1.17          mime_type = blob->mime_type;