mirror of
https://github.com/systemd/systemd.git
synced 2024-10-30 06:25:37 +03:00
parent
fa2ba7aea8
commit
4e88a46bfe
@ -116,6 +116,9 @@ sd_lldp_neighbor *lldp_neighbor_unlink(sd_lldp_neighbor *n) {
|
||||
sd_lldp_neighbor *lldp_neighbor_new(size_t raw_size) {
|
||||
sd_lldp_neighbor *n;
|
||||
|
||||
if (raw_size > SIZE_MAX - ALIGN(sizeof(sd_lldp_neighbor)))
|
||||
return NULL;
|
||||
|
||||
n = malloc0(ALIGN(sizeof(sd_lldp_neighbor)) + raw_size);
|
||||
if (!n)
|
||||
return NULL;
|
||||
|
@ -21,6 +21,9 @@ DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(sd_ndisc_router, sd_ndisc_router, mfree);
|
||||
sd_ndisc_router *ndisc_router_new(size_t raw_size) {
|
||||
sd_ndisc_router *rt;
|
||||
|
||||
if (raw_size > SIZE_MAX - ALIGN(sizeof(sd_ndisc_router)))
|
||||
return NULL;
|
||||
|
||||
rt = malloc0(ALIGN(sizeof(sd_ndisc_router)) + raw_size);
|
||||
if (!rt)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user