chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-rtnl: message - protect against SEGFAULT when reading messages
[elogind.git]
/
src
/
libsystemd
/
sd-rtnl
/
test-rtnl.c
diff --git
a/src/libsystemd/sd-rtnl/test-rtnl.c
b/src/libsystemd/sd-rtnl/test-rtnl.c
index 6ecd6603ae25de55efcf30d4741094ea4c3b0bf9..6d9159cd1160478d36ad41c24969083d837d8cc1 100644
(file)
--- a/
src/libsystemd/sd-rtnl/test-rtnl.c
+++ b/
src/libsystemd/sd-rtnl/test-rtnl.c
@@
-152,6
+152,7
@@
static void test_address_get(sd_rtnl *rtnl, int ifindex) {
sd_rtnl_message *m;
sd_rtnl_message *r;
struct in_addr in_data;
sd_rtnl_message *m;
sd_rtnl_message *r;
struct in_addr in_data;
+ char *label;
assert_se(sd_rtnl_message_new_addr(rtnl, &m, RTM_GETADDR, ifindex, AF_INET) >= 0);
assert_se(m);
assert_se(sd_rtnl_message_new_addr(rtnl, &m, RTM_GETADDR, ifindex, AF_INET) >= 0);
assert_se(m);
@@
-160,8
+161,7
@@
static void test_address_get(sd_rtnl *rtnl, int ifindex) {
assert_se(sd_rtnl_message_read_in_addr(r, IFA_LOCAL, &in_data) == 0);
assert_se(sd_rtnl_message_read_in_addr(r, IFA_ADDRESS, &in_data) == 0);
assert_se(sd_rtnl_message_read_in_addr(r, IFA_LOCAL, &in_data) == 0);
assert_se(sd_rtnl_message_read_in_addr(r, IFA_ADDRESS, &in_data) == 0);
- assert_se(sd_rtnl_message_read_in_addr(r, IFA_LABEL, &in_data) == 0);
- assert_se(sd_rtnl_message_read_in_addr(r, IFA_CACHEINFO, &in_data) == 0);
+ assert_se(sd_rtnl_message_read_string(r, IFA_LABEL, &label) == 0);
assert_se(sd_rtnl_flush(rtnl) >= 0);
assert_se((m = sd_rtnl_message_unref(m)) == NULL);
assert_se(sd_rtnl_flush(rtnl) >= 0);
assert_se((m = sd_rtnl_message_unref(m)) == NULL);