]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2372] catch a buggy case of bogus ID in State::getInstance
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 12 Nov 2012 20:12:58 +0000 (12:12 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 12 Nov 2012 20:12:58 +0000 (12:12 -0800)
src/lib/dns/master_lexer.cc

index 6087038d164da090779da302277e9c3a8ee45a76..8ee70c795bd3ef0b9f00969b391063701cbff2d5 100644 (file)
@@ -218,6 +218,12 @@ State::getInstance(ID state_id) {
     case String:
         return (STRING_STATE);
     }
+
+    // This is a bug of the caller, and this method is only expected to be
+    // used by tests, so we just forcefully make it fail by asserting the
+    // condition.
+    assert(false);
+    return (STRING_STATE); // a dummy return, to silence some compilers.
 }
 
 const State*