If we're not given any data for the Attachment, bail.
authorNathan Caldwell <saintdev@gmail.com>
Tue, 13 Jan 2009 05:58:56 +0000 (12 22:58 -0700)
committerNathan Caldwell <saintdev@gmail.com>
Tue, 13 Jan 2009 05:58:56 +0000 (12 22:58 -0700)
src/attachments.c

index 4492c8a..e5e9e40 100644 (file)
@@ -33,6 +33,10 @@ int mk_createAttachment(
 {
        mk_Context *attach;
        unsigned long file_uid;
+
+       if ((data == NULL) || (size == 0))
+               return -1;
+       
        /*
         * Generate a random UID for this Attachment.
         * NOTE: This probably should be a CRC32 of file data.