mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 11:11:12 -04:00 
			
		
		
		
	Ensure that mbedtls_pk_parse_key() does not allocate 0 bytes
This commit is contained in:
		
							parent
							
								
									c9d6226d2c
								
							
						
					
					
						commit
						e9124b943d
					
				| @ -1274,6 +1274,9 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *pk, | ||||
|     { | ||||
|         unsigned char *key_copy; | ||||
| 
 | ||||
|         if( keylen == 0 ) | ||||
|             return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT ); | ||||
| 
 | ||||
|         if( ( key_copy = mbedtls_calloc( 1, keylen ) ) == NULL ) | ||||
|             return( MBEDTLS_ERR_PK_ALLOC_FAILED ); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Andres Amaya Garcia
						Andres Amaya Garcia