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
Undefined behavior when missing fields in URI #72
What happens if I call user_info(uri) on the following URL? It seems behavior is undefined, and there is no clear way to check if user_info exists or not.
An API change to something like the following is one possibility:
assert(user_info(uri) == "");
And the case where the user_info data is present:
(similar changes would need to be made for query(), et al.)
This bug was introduced when I changed the implementation from strings to iterator_range. The parts that were empty were simply not being initialized. I fixed the failures by reverting all the iterator ranges to strings again in uri_parts.
I still think using iterator_range is a better strategy in the long run, but I didn't have enough experience in Boost.Spirit to apply this correctly.
All tests now pass on MSVC 10.0 and GCC 4.4.