Skip to content

Commit cd3d827

Browse files
committed
Merge branch 'ax_port_read-overflow'
2 parents c7c4d95 + ea8e476 commit cd3d827

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
@@ -587,7 +587,7 @@ int ax_port_read(int fd, uint8_t *data, int len) {
587587
return 0;
588588
}
589589

590-
read_buf =(uint8_t*)calloc(fd_data->tcp_pbuf->len + 1, sizeof(uint8_t));
590+
read_buf =(uint8_t*)calloc(len, sizeof(uint8_t));
591591
pread_buf = read_buf;
592592
if (pread_buf != NULL){
593593
recv_len = pbuf_copy_partial(fd_data->tcp_pbuf, read_buf, len, fd_data->pbuf_offset);

0 commit comments

Comments
 (0)