]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#150,!385] Addressed review comments:
authorTomek Mrugalski <tomasz@isc.org>
Wed, 14 Aug 2019 08:12:28 +0000 (10:12 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 14 Aug 2019 08:13:02 +0000 (10:13 +0200)
- extra checks for parent pointer
- comments corrected

src/lib/eval/tests/token_unittest.cc
src/lib/eval/token.cc
src/lib/eval/token.h

index a038ee7c9b1cf56b965708f4605746be24b396b5..0852e3f3d2e24c5d1030ce00c37881b105ce4b5d 100644 (file)
@@ -2984,7 +2984,7 @@ TEST_F(TokenTest, subOptionNoOption) {
     // we should have one value on the stack
     ASSERT_EQ(1, values_.size());
 
-    // The option should NOT be found (there is option 82),
+    // The option should NOT be found (there is no option 82),
     // so the expression should evaluate to ""
     EXPECT_EQ("", values_.top());
 
index 482a9cd597bea4ee1223a3df0bda55e311c1564c..ab42ac0dfe1ef3c077714d4d609e896754fb5a6d 100644 (file)
@@ -988,6 +988,9 @@ TokenInteger::TokenInteger(const uint32_t value)
 
 OptionPtr
 TokenSubOption::getSubOption(const OptionPtr& parent) {
+    if (!parent) {
+        return (OptionPtr());
+    }
     return (parent->getOption(sub_option_code_));
 }
 
index 8275f98da1a12c7a440f969bfa605c33e7c7a302..d233973198d7f91b724ba9b9e29bfed6d15dc6a5 100644 (file)
@@ -1060,7 +1060,7 @@ protected:
 /// @brief Token that represents sub-options in DHCPv4 and DHCPv6.
 ///
 /// It covers any options which encapsulate sub-options, for instance
-/// dhcp-agent-options (72, DHCPv4) or rsoo (66, DHCPv6).
+/// dhcp-agent-options (82, DHCPv4) or rsoo (66, DHCPv6).
 /// This class is derived from TokenOption and leverages its ability
 /// to operate on sub-options. It also adds additional capabilities.
 ///