Browse code

Better handling of empty data

git-svn: trunk@1258

Nigel Horne authored on 2005/01/19 14:30:50
Showing 1 changed files
... ...
@@ -16,6 +16,9 @@
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  *
18 18
  * $Log: blob.c,v $
19
+ * Revision 1.30  2005/01/19 05:30:50  nigelhorne
20
+ * Better handling of empty data
21
+ *
19 22
  * Revision 1.29  2004/12/21 16:52:45  nigelhorne
20 23
  * Patch for OS/2
21 24
  *
... ...
@@ -89,7 +92,7 @@
89 89
  * Change LOG to Log
90 90
  *
91 91
  */
92
-static	char	const	rcsid[] = "$Id: blob.c,v 1.29 2004/12/21 16:52:45 nigelhorne Exp $";
92
+static	char	const	rcsid[] = "$Id: blob.c,v 1.30 2005/01/19 05:30:50 nigelhorne Exp $";
93 93
 
94 94
 #if HAVE_CONFIG_H
95 95
 #include "clamav-config.h"
... ...
@@ -303,6 +306,8 @@ blobGetData(const blob *b)
303 303
 	assert(b != NULL);
304 304
 	assert(b->magic == BLOB);
305 305
 
306
+	if(b->len == 0)
307
+		return NULL;
306 308
 	return(b->data);
307 309
 }
308 310