From 1622febc69d703def3d4dccd1d036c5e507ec4d5 Mon Sep 17 00:00:00 2001 From: Nathan Caldwell Date: Mon, 12 Jan 2009 22:58:56 -0700 Subject: [PATCH] If we're not given any data for the Attachment, bail. --- src/attachments.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/attachments.c b/src/attachments.c index 4492c8a..e5e9e40 100644 --- a/src/attachments.c +++ b/src/attachments.c @@ -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. -- 2.11.4.GIT