This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bogus code in coffgen.c?


In coffgen.c, there is

    290   if (internal_f.f_opthdr)
    291     {
    292       PTR opthdr;
    293 
    294       opthdr = bfd_alloc (abfd, aoutsz);
					^^^^^^^^
    295       if (opthdr == NULL)
    296         return 0;;
    297       if (bfd_bread (opthdr, (bfd_size_type) internal_f.f_opthdr, abfd)
						     ^^^^^^^^^^^^^^^^^^^
    298           != internal_f.f_opthdr)
    299         {
    300           return 0;
    301         }
    302       bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) &internal_a);
    303     }
    304 

We allocate a buffer of `aoutsz' bytes. Then we read `internal_f.f_opthdr'
bytes into it. Why?



H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]