Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
map: api: fix tag overflow and leak
[vpp.git]
/
src
/
plugins
/
map
/
map_api.c
diff --git
a/src/plugins/map/map_api.c
b/src/plugins/map/map_api.c
index
418f6a0
..
7327732
100644
(file)
--- a/
src/plugins/map/map_api.c
+++ b/
src/plugins/map/map_api.c
@@
-40,7
+40,7
@@
vl_api_map_add_domain_t_handler (vl_api_map_add_domain_t * mp)
u32 index;
u8 flags = 0;
u32 index;
u8 flags = 0;
-
u8 *tag = format (0, "%s", mp->tag)
;
+
mp->tag[ARRAY_LEN (mp->tag) - 1] = '\0'
;
rv =
map_create_domain ((ip4_address_t *) & mp->ip4_prefix.address,
mp->ip4_prefix.len,
rv =
map_create_domain ((ip4_address_t *) & mp->ip4_prefix.address,
mp->ip4_prefix.len,
@@
-48,8
+48,9
@@
vl_api_map_add_domain_t_handler (vl_api_map_add_domain_t * mp)
mp->ip6_prefix.len,
(ip6_address_t *) & mp->ip6_src.address,
mp->ip6_src.len, mp->ea_bits_len, mp->psid_offset,
mp->ip6_prefix.len,
(ip6_address_t *) & mp->ip6_src.address,
mp->ip6_src.len, mp->ea_bits_len, mp->psid_offset,
- mp->psid_length, &index, ntohs (mp->mtu), flags, tag);
- vec_free (tag);
+ mp->psid_length, &index, ntohs (mp->mtu), flags,
+ mp->tag);
+
/* *INDENT-OFF* */
REPLY_MACRO2(VL_API_MAP_ADD_DOMAIN_REPLY,
({
/* *INDENT-OFF* */
REPLY_MACRO2(VL_API_MAP_ADD_DOMAIN_REPLY,
({