Addendum to #20: ensured empty-node list head is valid
authorKrista Grothoff <krista@pep-project.org>
Sun, 17 Jul 2016 20:37:08 +0200
changeset 90130725fee8f85
parent 900 2b8f651433ee
child 902 e9c70ca2bed6
Addendum to #20: ensured empty-node list head is valid
src/bloblist.c
     1.1 --- a/src/bloblist.c	Sun Jul 17 20:32:41 2016 +0200
     1.2 +++ b/src/bloblist.c	Sun Jul 17 20:37:08 2016 +0200
     1.3 @@ -102,6 +102,9 @@
     1.4          return new_bloblist(blob, size, mime_type, filename);
     1.5  
     1.6      if (bloblist->value == NULL) { // empty list
     1.7 +        if (bloblist->next != NULL)
     1.8 +            return NULL; // invalid list
     1.9 +            
    1.10          if (mime_type) {
    1.11              bloblist->mime_type = strdup(mime_type);
    1.12              if (bloblist->mime_type == NULL) {