This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug cli/14321] New: find can clobber memory
- From: "jan.kratochvil at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 01 Jul 2012 18:51:04 +0000
- Subject: [Bug cli/14321] New: find can clobber memory
- Auto-submitted: auto-generated
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.