Bug #1304
closed
Name::get should check bounds
Added by Junxiao Shi over 11 years ago.
Updated over 11 years ago.
Description
// g++ name-get.cpp -lndn-cpp-dev -pthread -lboost_system -lboost_filesystem -lcrypto -lcryptopp -lsqlite3 -lrt
#include <ndn-cpp-dev/name.hpp>
int
main()
{
ndn::Name name("ndn:/hello");
std::cout << name.get(999);
std::cout << name.get(-999);
return 0;
}
Expected: throw exception
Actual: segmentfault
- Tracker changed from Task to Bug
Wow I can edit issues in ndn-cpp-dev now.
I don't want to fix this. It is not library's responsibility to check the bounds of the container...
I don't want to fix this. It is not library's responsibility to check the bounds of the container...
Then this should be specified in a Doxygen comment.
The STL convention is, operator[] does not check bounds, at checks bounds.
In Name class, both are aliases of get and don't check bounds.
At least, bounds checking should be added to at method.
- Status changed from New to Closed
at command is checking bounds as of commit:c23442992
Also available in: Atom
PDF