mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 12:33:39 +08:00
Fix tls_recv buffer overflow bug
This commit is contained in:
@@ -718,7 +718,7 @@ typedef struct {
|
|||||||
|
|
||||||
uint8_t record[TLS_MAX_RECORD_SIZE];
|
uint8_t record[TLS_MAX_RECORD_SIZE];
|
||||||
|
|
||||||
uint8_t databuf[TLS_MAX_PLAINTEXT_SIZE];
|
uint8_t databuf[TLS_MAX_RECORD_SIZE];
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
size_t datalen;
|
size_t datalen;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ int format_bytes(FILE *fp, int format, int indent, const char *str, const uint8_
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (datalen > 4096) {
|
if (datalen > (1<<24)) {
|
||||||
error_print();
|
error_print();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user