This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug remote/18721] New: endless loop in sh-stub.c
- From: "pipcet at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 26 Jul 2015 17:03:37 +0000
- Subject: [Bug remote/18721] New: endless loop in sh-stub.c
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=18721
Bug ID: 18721
Summary: endless loop in sh-stub.c
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: remote
Assignee: unassigned at sourceware dot org
Reporter: pipcet at gmail dot com
Target Milestone: ---
I would like to report the following bug in sh-stub.c, which affected me when
using the file as a template for my own gdb stubs file:
diff --git a/gdb/stubs/sh-stub.c b/gdb/stubs/sh-stub.c
index 76c98a5..20407a0 100644
--- a/gdb/stubs/sh-stub.c
+++ b/gdb/stubs/sh-stub.c
@@ -469,7 +469,7 @@ putpacket (char *buffer)
/* Do run length encoding */
for (runlen = 0; runlen < 100; runlen ++)
{
- if (src[0] != src[runlen])
+ if (src[0] != src[runlen] || runlen == 99)
{
if (runlen > 3)
{
Without this fix, putpacket() will loop endlessly when presented with an
all-zero buffer.
Thanks!
--
You are receiving this mail because:
You are on the CC list for the bug.