From a8bcbe94911d13718d07f5dd6f5fdb1f76c58ded Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Tue, 6 Mar 2012 00:23:54 +0100 Subject: [PATCH] SF Bug Tracker id 3497159 - Bug fix in Parser_readFileOrBuffer Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 14:20:58 PST fileSize = ftell( xmlFilePtr ); can return a negative value, in this case the function should exit (at the moment, the function exits only if ftell returns 0). --- ChangeLog | 10 ++++++++++ ixml/src/ixmlparser.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 62c5e4d..4a9c081 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ Version 1.6.16 ******************************************************************************* +2012-03-05 Fabrice Fontaine + + SF Bug Tracker id 3497159 - Bug fix in Parser_readFileOrBuffer + + Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 14:20:58 PST + + fileSize = ftell( xmlFilePtr ); can return a negative value, in this + case the function should exit (at the moment, the function exits only + if ftell returns 0). + 2012-03-05 Fabrice Fontaine SF Bug Tracker id 3497140 - Bug fix in http_get_code_text diff --git a/ixml/src/ixmlparser.c b/ixml/src/ixmlparser.c index 2a700ff..05694e2 100644 --- a/ixml/src/ixmlparser.c +++ b/ixml/src/ixmlparser.c @@ -2,6 +2,7 @@ * * Copyright (c) 2000-2003 Intel Corporation * All rights reserved. + * Copyright (c) 2012 France Telecom All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2532,7 +2533,7 @@ static int Parser_readFileOrBuffer( } else { fseek( xmlFilePtr, 0, SEEK_END ); fileSize = ftell( xmlFilePtr ); - if( fileSize == 0 ) { + if( fileSize <= 0 ) { fclose( xmlFilePtr ); return IXML_SYNTAX_ERR; }