out of memory condition check sync
authorVolker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 12:33:59 +0200
branchsync
changeset 30842addd22aad87
parent 3083 da1eb049cca1
child 3085 d838e2d02278
out of memory condition check
src/message_api.c
     1.1 --- a/src/message_api.c	Sun Oct 21 12:31:32 2018 +0200
     1.2 +++ b/src/message_api.c	Sun Oct 21 12:33:59 2018 +0200
     1.3 @@ -2354,6 +2354,10 @@
     1.4      size_t boundary_strlen = (end_boundary - start_boundary) + 2;
     1.5  
     1.6      signed_boundary = calloc(boundary_strlen + 1, 1);
     1.7 +    assert(signed_boundary);
     1.8 +    if (!signed_boundary)
     1.9 +        return PEP_OUT_OF_MEMORY;
    1.10 +
    1.11      strlcpy(signed_boundary, "--", boundary_strlen + 1);
    1.12      strlcat(signed_boundary, start_boundary, boundary_strlen + 1);
    1.13