diff options
author | Steven Siloti <ssiloti@gmail.com> | 2014-03-30 21:20:26 -0700 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-03-31 09:54:37 +0200 |
commit | c8a7165f582c322628a9b07fc7e01d0aab184b48 (patch) | |
tree | 052efe0be583fea8595ef731c7a24dbe8a141518 /src | |
parent | 42742bf1ce3a2a4fecb82df9d8adea57133ae33b (diff) |
sd-rtnl: fix off-by-one
Also fix type parameter passed to new0
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index 5265184098..4ace94ce18 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -911,11 +911,11 @@ int rtnl_message_parse(sd_rtnl_message *m, unsigned short type; size_t *tb; - tb = (size_t *) new0(size_t *, max); + tb = new0(size_t, max + 1); if(!tb) return -ENOMEM; - *rta_tb_size = max; + *rta_tb_size = max + 1; for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) { type = rta->rta_type; |