Skip to content

Commit ea8e476

Browse files
committed
Buffer overflow in ax_port_read
1 parent 1547686 commit ea8e476

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tcp_axtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ int ax_port_read(int fd, uint8_t *data, int len) {
562562
return 0;
563563
}
564564

565-
read_buf =(uint8_t*)calloc(fd_data->tcp_pbuf->len + 1, sizeof(uint8_t));
565+
read_buf =(uint8_t*)calloc(len, sizeof(uint8_t));
566566
pread_buf = read_buf;
567567
if (pread_buf != NULL){
568568
recv_len = pbuf_copy_partial(fd_data->tcp_pbuf, read_buf, len, fd_data->pbuf_offset);

0 commit comments

Comments
 (0)