The function efi_pecoff_debug_name() (called by efi_handle_name()) is
used to extract a filename from the debug data directory entry located
within a PE/COFF image. The name is copied into a temporary static
buffer to allow for modifications, but the code currently erroneously
modifies the original name within the loaded PE/COFF image.
Fix by performing the modification on the copy in the temporary
buffer, as originally intended.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
snprintf ( buf, sizeof ( buf ), "%s", name );
/* Strip file suffix, if present */
- if ( ( tmp = strrchr ( name, '.' ) ) != NULL )
+ if ( ( tmp = strrchr ( buf, '.' ) ) != NULL )
*tmp = '\0';
- return name;
+ return buf;
}
/**