Project

General

Profile

Bug #4181

Updated by Junxiao Shi over 7 years ago

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.

Back