summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-option.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-14 22:06:37 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-09-14 22:47:21 +0200
commit86be3e1e6558f4e7e20c537e644656eb6f37b7d0 (patch)
tree87034ccbac6bb597e7cc82be36370d98d7e61018 /src/libsystemd-network/test-dhcp-option.c
parentd1c457badfce0dc86b54b2cac2c5eec99d7bc65e (diff)
sd-dhcp: fix test of magic cookie
The magic cookie is set in dhcp_message_init. Test the magic cookie value intead of writing the last 3/4 of it directly. Found with Coverity. Fixes: CID#1237732 CID#1237734 CID#1237735
Diffstat (limited to 'src/libsystemd-network/test-dhcp-option.c')
-rw-r--r--src/libsystemd-network/test-dhcp-option.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index 92c58e0d58..7a0fac8d33 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -100,9 +100,9 @@ static void test_message_init(void)
magic = (uint8_t*)&message->magic;
assert_se(magic[0] == 99);
- assert_se(magic[1] = 130);
- assert_se(magic[2] = 83);
- assert_se(magic[3] = 99);
+ assert_se(magic[1] == 130);
+ assert_se(magic[2] == 83);
+ assert_se(magic[3] == 99);
assert_se(dhcp_option_parse(message, len, NULL, NULL) >= 0);
}