pe_section_name accidentally replaces the last character in section names that are 8 bytes long with a NUL. This results in a section header name like .cmdline1 being printed as .cmdlin.
This addresses the off-by-one issue by ensuring we have a NUL at the end of our buffer (which is >= 9 bytes) instead putting it at the byte before the end.
pe_section_name accidentally replaces the last character in section names that are 8 bytes long with a NUL. This results in a section header name like
.cmdline
1 being printed as.cmdlin
.This addresses the off-by-one issue by ensuring we have a NUL at the end of our buffer (which is >= 9 bytes) instead putting it at the byte before the end.