Make NAR header check more robust
Changes std::bad_alloc into bad archive: input doesn't look like a Nix archive
This commit is contained in:
		
							parent
							
								
									7ccdcc7fed
								
							
						
					
					
						commit
						44e86304b6
					
				
					 3 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -284,7 +284,7 @@ inline uint64_t readLongLong(Source & source)
 | 
			
		|||
 | 
			
		||||
void readPadding(size_t len, Source & source);
 | 
			
		||||
size_t readString(unsigned char * buf, size_t max, Source & source);
 | 
			
		||||
string readString(Source & source);
 | 
			
		||||
string readString(Source & source, size_t max = std::numeric_limits<size_t>::max());
 | 
			
		||||
template<class T> T readStrings(Source & source);
 | 
			
		||||
 | 
			
		||||
Source & operator >> (Source & in, string & s);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue