diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 484632addb..b4672fa50c 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-06-23 Nick Clifton + + PR binutils/21659 + * strings.c (strings_file): Warn about attempts to run strings on + a directory. + 2017-06-22 H.J. Lu * readelf.c (decode_x86_feature): Decode diff --git a/binutils/strings.c b/binutils/strings.c index 13e261923b..77d89eb981 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -446,6 +446,11 @@ strings_file (char *file) file, strerror (errno)); return FALSE; } + else if (S_ISDIR (st.st_mode)) + { + non_fatal (_("Warning: '%s' is a directory"), file); + return FALSE; + } /* If we weren't told to scan the whole file, try to open it as an object file and only look at