This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug cli/14321] New: find can clobber memory


http://sourceware.org/bugzilla/show_bug.cgi?id=14321

             Bug #: 14321
           Summary: find can clobber memory
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jan.kratochvil@redhat.com
    Classification: Unclassified


GNU gdb (GDB) 7.4.50.20120630-cvs
./gdb ./gdb
(gdb) find main,+100000000,xop_table
memory clobbered past end of allocated block

This code does not expect val_bytes can be huge:
findcmd.c:
      /* Keep it simple and assume size == 'g' when watching for when we
         need to grow the pattern buf.  */
      if ((pattern_buf_end - pattern_buf + max (val_bytes, sizeof (int64_t)))
          > pattern_buf_size)
        {
          size_t current_offset = pattern_buf_end - pattern_buf;

          pattern_buf_size *= 2;
          pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
          pattern_buf_end = pattern_buf + current_offset;
        }

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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