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).
This commit is contained in:
Fabrice Fontaine 2012-03-06 00:23:54 +01:00
parent 1a1570fe0f
commit a8bcbe9491
2 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,16 @@
Version 1.6.16 Version 1.6.16
******************************************************************************* *******************************************************************************
2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
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 <fabrice.fontaine(at)orange.com> 2012-03-05 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
SF Bug Tracker id 3497140 - Bug fix in http_get_code_text SF Bug Tracker id 3497140 - Bug fix in http_get_code_text

View File

@ -2,6 +2,7 @@
* *
* Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
* All rights reserved. * All rights reserved.
* Copyright (c) 2012 France Telecom All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -2532,7 +2533,7 @@ static int Parser_readFileOrBuffer(
} else { } else {
fseek( xmlFilePtr, 0, SEEK_END ); fseek( xmlFilePtr, 0, SEEK_END );
fileSize = ftell( xmlFilePtr ); fileSize = ftell( xmlFilePtr );
if( fileSize == 0 ) { if( fileSize <= 0 ) {
fclose( xmlFilePtr ); fclose( xmlFilePtr );
return IXML_SYNTAX_ERR; return IXML_SYNTAX_ERR;
} }