Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Code looks like this
strncpy(buf, ipaddr.c_str(),ipaddr.size());
But should be
strncpy(buf, ipaddr.c_str(),ipaddr.size()+1);
In order to make sure there is at least 1 null terminating byte. If we could run the minidfscluster an another process and run valgrind on the libhdfs++ tests this would show up really quickly as a sequence of invalid reads when that const char* was passed to std::string::string(const char*), strlen, or strcpy.