OCT 1. 修正缓冲区可能溢出问题
This commit is contained in:
parent
b49e3595db
commit
fe0b357300
|
@ -36,7 +36,7 @@ static int disk_info_refresh() {
|
|||
int i = 0;
|
||||
int errCode = ERR_SUCCESS;
|
||||
FILE *fp;
|
||||
char buf[MAX_PATH];
|
||||
char buf[MAX_PATH * 2];
|
||||
|
||||
fp = popen(CMD_DISK_FILESYSTEM, "r");
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ unsigned int get_sys_total_memory() {
|
|||
static int memory_info_refresh() {
|
||||
int errCode = ERR_SUCCESS;
|
||||
FILE *fp;
|
||||
char buf[MAX_PATH];
|
||||
char buf[MAX_PATH * 2];
|
||||
|
||||
fp = popen(CMD_MEMORY_INFO, "r");
|
||||
|
||||
|
|
|
@ -701,6 +701,8 @@ static zvect_retval p_vect_set_capacity(vector const v, const zvect_index direct
|
|||
return ZVERR_OUTOFMEM;
|
||||
}
|
||||
|
||||
memset(new_data, 0, sizeof(void *) * (new_capacity + v->cap_right));
|
||||
|
||||
zvect_index nb;
|
||||
zvect_index ne;
|
||||
nb = v->cap_left;
|
||||
|
|
Loading…
Reference in New Issue