strings 2.10.90 coredumps when input is from /dev/fd/*

H . J . Lu hjl@valinux.com
Tue Feb 27 08:47:00 GMT 2001


On Tue, Feb 27, 2001 at 04:23:21PM +0000, Robin Houston wrote:
> bash$ strings <(ls)
> Segmentation fault (core dumped)
> 
> 
> The problem will also manifest itself reading from
> a named pipe:
> 
> bash$ mkfifo /tmp/fifo
> bash$ cat </etc/passwd >/tmp/fifo&
> [1] 8238
> bash$ strings /tmp/fifo
> [1]+  Done                    cat </etc/passwd >/tmp/fifo
> Segmentation fault (core dumped)
> 
> 
> The problem exists in v2.9.1 also.
> 
>  .robin.

Thanks for your bug report. Here is a patch. Nick, can I apply it?



-- 
H.J. Lu (hjl@valinux.com)
----
2001-02-27  H.J. Lu  <hjl@gnu.org>

	* aoutx.h (NAME(aout,bfd_free_cached_info)): Return true if
	abfd->tdata.aout_data == NULL.

Index: aoutx.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/aoutx.h,v
retrieving revision 1.10
diff -u -p -r1.10 aoutx.h
--- aoutx.h	2001/01/24 04:33:25	1.10
+++ aoutx.h	2001/02/27 16:39:14
@@ -2906,7 +2906,8 @@ NAME(aout,bfd_free_cached_info) (abfd)
 {
   asection *o;
 
-  if (bfd_get_format (abfd) != bfd_object)
+  if (bfd_get_format (abfd) != bfd_object
+      || abfd->tdata.aout_data == NULL)
     return true;
 
 #define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; }



More information about the Binutils mailing list