mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 07:31:54 +00:00
Not calling memcpy with n=0.
This commit is contained in:
parent
124d860f64
commit
d607205486
@ -72,6 +72,15 @@ bstrcmp(const char *s1, const char *s2)
|
|||||||
return !s2 - !s1;
|
return !s2 - !s1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void *
|
||||||
|
bmemcpy(void *dest, const void *src, size_t n)
|
||||||
|
{
|
||||||
|
if (n)
|
||||||
|
return memcpy(dest, src, n);
|
||||||
|
else
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
#define ROUTER_ID_64_LENGTH 23
|
#define ROUTER_ID_64_LENGTH 23
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -552,7 +552,7 @@ static inline void
|
|||||||
bgp_set_attr_data(ea_list **to, struct linpool *pool, uint code, uint flags, void *data, uint len)
|
bgp_set_attr_data(ea_list **to, struct linpool *pool, uint code, uint flags, void *data, uint len)
|
||||||
{
|
{
|
||||||
struct adata *a = lp_alloc_adata(pool, len);
|
struct adata *a = lp_alloc_adata(pool, len);
|
||||||
memcpy(a->data, data, len);
|
bmemcpy(a->data, data, len);
|
||||||
bgp_set_attr(to, pool, code, flags, (uintptr_t) a);
|
bgp_set_attr(to, pool, code, flags, (uintptr_t) a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user