Actions
Bug #4181
closedName::end undefined behavior
Start date:
07/11/2017
Due date:
% Done:
100%
Estimated time:
1.00 h
Description
Snippet to reproduce:
// g++ -std=c++11 -o x x.cpp $(pkg-config --cflags --libs libndn-cxx) -fsanitize=undefined
#include <ndn-cxx/name.hpp>
int
main()
{
ndn::Name n0;
n0.end();
}
Actual: /usr/include/c++/5/bits/stl_iterator.h:754:17: runtime error: reference binding to null pointer of type 'const struct Block'
Expected: no such error
Additionally, Name::begin()
also triggers undefined behavior if name is empty.
Actions