src/etpan_mime.c
changeset 903 7a040beb4000
parent 820 03e6929fe32b
child 1513 e7f7e42385b5
     1.1 --- a/src/etpan_mime.c	Sun Jul 17 20:59:35 2016 +0200
     1.2 +++ b/src/etpan_mime.c	Sun Jul 17 23:48:45 2016 +0200
     1.3 @@ -755,9 +755,10 @@
     1.4          if (_type == NULL)
     1.5              return ENOMEM;
     1.6  
     1.7 -        strcpy(_type, _main_type);
     1.8 -        strcat(_type, "/");
     1.9 -        strcat(_type, content->ct_subtype);
    1.10 +        strncpy(_type, _main_type, len);
    1.11 +        len -= strlen(_main_type);
    1.12 +        strncat(_type, "/", len--);
    1.13 +        strncat(_type, content->ct_subtype, len);
    1.14  
    1.15          if (content->ct_parameters) {
    1.16              clistiter *cur;