Actions
Bug #1304
closedName::get should check bounds
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
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
Updated by Junxiao Shi over 11 years ago
- Tracker changed from Task to Bug
Wow I can edit issues in ndn-cpp-dev now.
Updated by Alex Afanasyev over 11 years ago
I don't want to fix this. It is not library's responsibility to check the bounds of the container...
Updated by Junxiao Shi over 11 years ago
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.
Updated by Junxiao Shi over 11 years ago
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.
Updated by Alex Afanasyev over 11 years ago
- Status changed from New to Closed
at command is checking bounds as of commit:c23442992
Actions