Skip to content

Commit

Permalink
Fix tls_recv buffer overflow bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Feb 6, 2024
1 parent 983fa90 commit b58ea74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/gmssl/tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ typedef struct {

uint8_t record[TLS_MAX_RECORD_SIZE];

uint8_t databuf[TLS_MAX_PLAINTEXT_SIZE];
uint8_t databuf[TLS_MAX_RECORD_SIZE];
uint8_t *data;
size_t datalen;

Expand Down
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int format_bytes(FILE *fp, int format, int indent, const char *str, const uint8_
{
int i;

if (datalen > 4096) {
if (datalen > (1<<24)) {
error_print();
return -1;
}
Expand Down

0 comments on commit b58ea74

Please sign in to comment.