CID 716836: Buffer not null terminated (BUFFER_SIZE_WARNING)At (1): Calling
strncpy with a maximum size argument of 4096 bytes on destination array
"dir_name" of size 4096 bytes might leave the destination string unterminated.
Signed-off-by: Samuel Just <sam.just@inktank.com>
int FlatIndex::collection_list(vector<hobject_t> *ls) {
char dir_name[PATH_MAX], buf[PATH_MAX], new_name[PATH_MAX];
strncpy(dir_name, base_path.c_str(), sizeof(dir_name));
+ dir_name[sizeof(dir_name)-1]='\0';
DIR *dir = ::opendir(dir_name);
if (!dir)