This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commited] small changes to fix hpux-cc compile


> Yes, this was indeed my thinking and why i hardcoded it.

So what happens if your hardcoded auto array of size 4 ever overflows?
We get a nasty bit of stack corruption.  I hate seeing code like this
creep into gdb.  It works until something else changes and then it
quietly crashes or prints random bad results.

The reason this code stopped compiling is that TARGET_INT_BIT became
more dynamic; it changed from a manifest constant to a function call.

  char dld_flags_buffer[4];
  ...
  status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
  
That's just wrong!

Michael C


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