File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1402,15 +1402,19 @@ int basic_read(SSL *ssl, uint8_t **in_data)
1402
1402
1403
1403
void increase_bm_data_size (SSL * ssl )
1404
1404
{
1405
- uint8_t * pr = (uint8_t * ) realloc (ssl -> bm_all_data , RT_MAX_PLAIN_LENGTH + RT_EXTRA );
1406
- if (pr ) {
1407
- ssl -> max_plain_length = RT_MAX_PLAIN_LENGTH ;
1408
- ssl -> bm_all_data = pr ;
1409
- ssl -> bm_data = pr + BM_RECORD_OFFSET ;
1405
+ if (ssl -> max_plain_length == RT_MAX_PLAIN_LENGTH ) {
1406
+ return ;
1410
1407
}
1411
- else {
1408
+
1409
+ free (ssl -> bm_all_data );
1410
+ ssl -> bm_data = 0 ;
1411
+ ssl -> bm_all_data = malloc (RT_MAX_PLAIN_LENGTH + RT_EXTRA );
1412
+ if (!ssl -> bm_all_data ) {
1412
1413
printf ("failed to grow plain buffer\r\n" );
1414
+ return ;
1413
1415
}
1416
+ ssl -> max_plain_length = RT_MAX_PLAIN_LENGTH ;
1417
+ ssl -> bm_data = ssl -> bm_all_data + BM_RECORD_OFFSET ;
1414
1418
}
1415
1419
1416
1420
/**
You can’t perform that action at this time.
0 commit comments