From e1104d08fe2fbfabcfa98aa00525211e47548bd8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 7 Feb 2020 12:49:42 +0000 Subject: Silcence a compile time warning message building the binutils with gcc-10 on an s390 host. * dwarf.c (display_debug_lines_decoded): Force a NUL termination of the truncated file name. --- binutils/ChangeLog | 5 +++++ binutils/dwarf.c | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9585438..3edf233 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2020-02-07 Nick Clifton + + * dwarf.c (display_debug_lines_decoded): Force a NUL termination + of the truncated file name. + 2020-02-06 Andrew Burgess * objdump.c (print_jump_visualisation): New function. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 35842f7..6ecfab5 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -4905,6 +4905,11 @@ display_debug_lines_decoded (struct dwarf_section * section, strncpy (newFileName, fileName + fileNameLength - MAX_FILENAME_LENGTH, MAX_FILENAME_LENGTH + 1); + /* FIXME: This is to pacify gcc-10 which can warn that the + strncpy above might leave a non-NUL terminated string + in newFileName. It won't, but gcc's analysis doesn't + quite go far enough to discover this. */ + newFileName[MAX_FILENAME_LENGTH] = 0; } else { -- cgit v1.1