1
1

usnic: ensure that stats string is always truncated

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2017-01-10 12:02:07 -08:00
родитель 1fdd0fe228
Коммит 706f53bb01

Просмотреть файл

@ -123,6 +123,11 @@ void opal_btl_usnic_print_stats(
module->stats.num_crc_errors);
// Shouldn't happen, but just in case the string ever grows long
// enough to someday potentially get truncated by snprintf, ensure
// that the string is terminated.
str[sizeof(str) - 1] = '\0';
/* If our PML calls were 0, then show send and receive window
extents instead */
if (module->stats.pml_module_sends +