apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject [PATCH] fix design bug in apr_file_gets()
Date Sun, 27 Apr 2003 18:13:05 GMT
change apr_file_gets() to return APR_SUCCESS if returning any data

current apr_file_gets() will return APR_EOF if it hit end of file before 

current callers of apr_file_gets() already need to check for existence 
of newline since buffer overflow will cause apr_file_gets() to return 
APR_SUCCESS + line with no '\n'; that logic will normally discover 
missing newline at end of file

this change will resolve bugs in such callers as mod_cgi and mod_cgid 
which did not have logic to find data with no final '\n' at end of file; 
conceivably it will make a number of other callers accept data when 
there is no '\n'

if somebody really really wants until apr 1.0 to fix this, we can have 
apr_file_gets_foo() until then for callers which would rather have apr 
do the heavy lifting instead of adding missing logic to deal with the 
fact that on normal files (pipes) where there are no I/O errors good 
data can come even when rv != APR_SUCCESS

View raw message