mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-31 05:48:56 +08:00 
			
		
		
		
	Fix potential unsoundness in SqliteMallocString
				
					
				
			This commit is contained in:
		| @@ -131,7 +131,8 @@ impl SqliteMallocString { | ||||
|                     //   (everything is aligned to 1) | ||||
|                     // - `size` is also never zero, although this function doesn't actually require | ||||
|                     //   it now. | ||||
|                     let layout = Layout::from_size_align_unchecked(s.len().saturating_add(1), 1); | ||||
|                     let len = s.len().saturating_add(1).min(isize::MAX as usize); | ||||
|                     let layout = Layout::from_size_align_unchecked(len, 1); | ||||
|                     // Note: This call does not return. | ||||
|                     handle_alloc_error(layout); | ||||
|                 }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user