mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Use correct sizeof() argument in a couple of strncpy calls
Source and destination buffers are however the same length in both cases. Per GitHub #561.
This commit is contained in:
@@ -1065,7 +1065,7 @@ build_cluster_matrix(t_node_matrix_rec ***matrix_rec_dest, int *name_length, Ite
|
|||||||
matrix_rec_list[i]->node_id = cell->node_info->node_id;
|
matrix_rec_list[i]->node_id = cell->node_info->node_id;
|
||||||
strncpy(matrix_rec_list[i]->node_name,
|
strncpy(matrix_rec_list[i]->node_name,
|
||||||
cell->node_info->node_name,
|
cell->node_info->node_name,
|
||||||
sizeof(cell->node_info->node_name));
|
sizeof(matrix_rec_list[i]->node_name));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the maximum length of a node name
|
* Find the maximum length of a node name
|
||||||
@@ -1280,7 +1280,7 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length, Item
|
|||||||
|
|
||||||
cube[h] = (t_node_status_cube *) pg_malloc(sizeof(t_node_status_cube));
|
cube[h] = (t_node_status_cube *) pg_malloc(sizeof(t_node_status_cube));
|
||||||
cube[h]->node_id = cell->node_info->node_id;
|
cube[h]->node_id = cell->node_info->node_id;
|
||||||
strncpy(cube[h]->node_name, cell->node_info->node_name, sizeof(cell->node_info->node_name));
|
strncpy(cube[h]->node_name, cell->node_info->node_name, sizeof(cube[h]->node_name));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the maximum length of a node name
|
* Find the maximum length of a node name
|
||||||
|
|||||||
Reference in New Issue
Block a user