Bug in boost::filesystem (1.33.1)

15 Mar
2007
15 Mar
'07
10:42 p.m.
Hi The function BOOST_FILESYSTEM_DECL path system_complete( const path & ph ) in operations_posix_windows.cpp contains the following code: char buf[MAX_PATH]; char * pfn; std::size_t len = ::GetFullPathNameA( ph.string().c_str(), sizeof(buf) , buf, &pfn ); if ( !len ) { boost::throw_exception( filesystem_error( "boost::filesystem::system_complete", ph, "size is 0" ) ); } buf[len] = '\0'; If the full path name is larger than MAX_PATH, the last line will cause a buffer overflow. This bug is not present in 1.34. Best regards Jorge Lodos
6668
Age (days ago)
6668
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jorge Lodos