map: api: fix tag overflow and leak 03/28303/1
authorBenoît Ganne <bganne@cisco.com>
Tue, 21 Jan 2020 17:24:44 +0000 (18:24 +0100)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 12 Aug 2020 15:59:46 +0000 (15:59 +0000)
commit7e8cd07b1f2b859847b050ab64e37955a04f90f9
tree17297afde27f68f18581b651e5423781066818a5
parent4e422269f8dbde16167bf0939f4a093c30624494
map: api: fix tag overflow and leak

The 'tag' parameter is expected to be a NULL-terminated C-string in
callees:
 - make sure it is null-terminated in both API and CLI cases
 - do not allocate & copy the string into a non-NULL-terminated vector
   in API case
 - fix leak in CLI case

Type: fix

Change-Id: I221a489a226240548cdeb5e3663bbfb94eee4600
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 3b37125bdb0251181f90a429a4532b339711cf89)
src/plugins/map/map.c
src/plugins/map/map_api.c