commit 108fd04264d96844b7e1eabd8501a504a39aa6ce parent ffb9f33f73353ef08724d38ae3ec14ba6a147521 Author: Michael Savage <mikejsavage@gmail.com> Date: Sun May 28 13:51:39 +0300 Check for entries that are too long in the manifest parser Diffstat:
launcher/main.cc | | | 4 | ++-- |
diff --git a/launcher/main.cc b/launcher/main.cc @@ -118,9 +118,9 @@ static bool parse_manifest( std::map< std::string, ManifestEntry > * manifest_pt const str< 256 > file_name( "{}", matches[ 0 ] ); const str< 16 > file_size( "{}", matches[ 2 ] ); - u64 size = u64( strtonum( file_size.c_str(), 1, S64_MAX, NULL ) ); - if( size == 0 ) { + + if( matches[ 0 ].n > file_name.len() || matches[ 2 ].n > file_size.len() || file_size == 0 ) { manifest.clear(); return false; }