diff -r e35f40988205 -r 29dae20d06bf xmlsecurityengine/xmlseccrypto/src/xmlsecc_bio.cpp --- 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) {