Browse Source

[2317] Pass a string object to is_any_of() instead of char* value.

This is a workaround for the warnings on Debian6: "array subscript is
above array bounds".
Marcin Siodelski 12 years ago
parent
commit
1cee583601
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/lib/dhcp/option_definition.cc

+ 3 - 3
src/lib/dhcp/option_definition.cc

@@ -220,12 +220,12 @@ OptionDefinition::validate() const {
     if (!all(name_, boost::is_from_range('a', 'z') ||
     if (!all(name_, boost::is_from_range('a', 'z') ||
              boost::is_from_range('A', 'Z') ||
              boost::is_from_range('A', 'Z') ||
              boost::is_digit() ||
              boost::is_digit() ||
-             boost::is_any_of("-_")) ||
+             boost::is_any_of(std::string("-_"))) ||
         name_.empty() ||
         name_.empty() ||
         // Hyphens and underscores are not allowed at the beginning
         // Hyphens and underscores are not allowed at the beginning
         // and at the end of the option name.
         // and at the end of the option name.
-        all(find_head(name_, 1), boost::is_any_of("-_")) ||
-        all(find_tail(name_, 1), boost::is_any_of("-_"))) {
+        all(find_head(name_, 1), boost::is_any_of(std::string("-_"))) ||
+        all(find_tail(name_, 1), boost::is_any_of(std::string("-_")))) {
         err_str << "invalid option name '" << name_ << "'";
         err_str << "invalid option name '" << name_ << "'";
 
 
     } else if (type_ >= OPT_UNKNOWN_TYPE) {
     } else if (type_ >= OPT_UNKNOWN_TYPE) {