char **argv = NULL;
int argc = 0;
int rc = 1;
- char *line = malloc(strlen(rl_line_buffer) + 2);
+ size_t len = strlen(rl_line_buffer);
+ char *line = malloc(len + 2);
if (!line) return -1;
- strcpy(line, rl_line_buffer);
+ strlcpy(line, rl_line_buffer, len + 2);
line[rl_point] = 2; /* empty character, will force a word */
line[rl_point+1] = 0;
hardware.h_lport.p_id = "Not used";
hardware.h_lport.p_id_len = strlen(hardware.h_lport.p_id);
hardware.h_lport.p_descr = "Not used";
- strcpy(hardware.h_ifname, "eth3");
+ strlcpy(hardware.h_ifname, "eth3", sizeof(hardware.h_ifname));
hardware.h_ifindex = 4;
chassis.c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
chassis.c_id = macaddress;
hardware.h_lport.p_id = "Not used";
hardware.h_lport.p_id_len = strlen(hardware.h_lport.p_id);
hardware.h_lport.p_descr = "Not used";
- strcpy(hardware.h_ifname, "eth3");
+ strlcpy(hardware.h_ifname, "eth3", sizeof(hardware.h_ifname));
hardware.h_ifindex = 4;
chassis.c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
chassis.c_id = macaddress;
#endif
hardware.h_mtu = 1500;
hardware.h_ifindex = 4;
- strcpy(hardware.h_ifname, "test");
+ strlcpy(hardware.h_ifname, "test", sizeof(hardware.h_ifname));
memcpy(hardware.h_lladdr, macaddress, ETHER_ADDR_LEN);
hardware.h_ops = &pcap_ops;
/* Prepare chassis */