projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42742bf
)
sd-rtnl: fix off-by-one
author
Steven Siloti
<ssiloti@gmail.com>
Mon, 31 Mar 2014 04:20:26 +0000
(21:20 -0700)
committer
Tom Gundersen
<teg@jklm.no>
Mon, 31 Mar 2014 07:54:37 +0000
(09:54 +0200)
Also fix type parameter passed to new0
src/libsystemd/sd-rtnl/rtnl-message.c
patch
|
blob
|
history
diff --git
a/src/libsystemd/sd-rtnl/rtnl-message.c
b/src/libsystemd/sd-rtnl/rtnl-message.c
index
5265184
..
4ace94c
100644
(file)
--- 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;