xmlsecurityengine/xmlseccrypto/src/xmlsecc_bio.cpp
changeset 1 29dae20d06bf
parent 0 e35f40988205
child 16 d10d750052f0
--- a/xmlsecurityengine/xmlseccrypto/src/xmlsecc_bio.cpp	Thu Dec 17 09:29:21 2009 +0200
+++ b/xmlsecurityengine/xmlseccrypto/src/xmlsecc_bio.cpp	Thu Jan 07 13:43:43 2010 +0200
@@ -88,7 +88,12 @@
 	    }
 	fseek(fp, 0, SEEK_END);
 	fileLen = ftell(fp);
-    fseek ( fp , 0L , SEEK_SET );
+	if(fileLen < 0)
+		{
+			xmlSecSetErrorFlag( KErrGeneral );
+			return(NULL);
+		}
+	fseek ( fp , 0L , SEEK_SET );
 	
 	buf = (char *)malloc(sizeof(char)*(fileLen+1));
     if(!buf) {