Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
LDAPFilter::Match throws std::runtime_error if a bundle contains a key that is a leading substring of another key #227
Calling LDAPFilter::Match on a bundle that contains the keys:
throws a std::runtime_error when creating an instance of cppmicroservices::Properties because Properties::Find_unlocked only does a strncasecmp of key.size() between key and keys[i].
Properties::Find_unlocked should check that the sizes of the two strings are equal before reporting duplicate keys and any exceptions thrown by Properties should be swallowed by LDAPFilter::Match before returning false since Match isn't supposed to throw exceptions.
The way this bug manifests is worth documenting - it's dependent on
Suppose the range-based iterator gives out the key
It turns out I can't reproduce the bug with the keys specified in the Issue, however I can reproduce the bug with different sets of keys i.e.