|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 86be3e1e6558f4e7e20c537e644656eb6f37b7d0 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sun, 14 Sep 2014 22:06:37 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] sd-dhcp: fix test of magic cookie
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
The magic cookie is set in dhcp_message_init. Test the magic cookie
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
value intead of writing the last 3/4 of it directly.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Found with Coverity. Fixes: CID#1237732 CID#1237734 CID#1237735
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-network/test-dhcp-option.c | 6 +++---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 92c58e0d58..7a0fac8d33 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-network/test-dhcp-option.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-network/test-dhcp-option.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -100,9 +100,9 @@ static void test_message_init(void)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
magic = (uint8_t*)&message->magic;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_se(magic[0] == 99);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert_se(magic[1] = 130);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert_se(magic[2] = 83);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert_se(magic[3] = 99);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_se(magic[1] == 130);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_se(magic[2] == 83);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_se(magic[3] == 99);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_se(dhcp_option_parse(message, len, NULL, NULL) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|