char tmp[MAX_LOG_LINE];
tmp[0] = 0;
for (int i = 0; i < names_num; i++) {
- std::strcat(tmp, names[i].name);
- std::strcat(tmp, " ");
+ std::strncat(tmp, names[i].name, sizeof(tmp) - strlen(tmp) - 1);
+ std::strncat(tmp, " ", sizeof(tmp) - strlen(tmp) - 1);
}
snprintf(str, MAX_LOG_LINE, "matcher: services(%s), interface(%s), member(%s), path(%s), type(%s), direction(%s)", tmp, interface, member, path, __message_type_to_str(type), __message_dir_to_str(direction) );
return str;