From: Andrew Cagney <ac131313@cygnus.com>
To: Orjan Friberg <orjan.friberg@axis.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFC: Run length encoding bug in remote.c?
Date: Fri, 10 Aug 2001 00:12:00 -0000 [thread overview]
Message-ID: <3B73891D.50209@cygnus.com> (raw)
In-Reply-To: <3B714363.F2A28837@axis.com>
> The patch below makes that change. Though this works (tested with
> "print *current" in gdb) and looks sensible to me, I have a feeling that
> this error should show up quite often for other people as well, since it
> would happen every time the response to an 'm' packet ends with
> run-length encoding of the data.
I don't know that many targets use run-length incoding and hence,
probably few have noticed the bug.
> I suspect that the (bc + repeat) in the condition should in fact be (bc
> + repeat - 1) since the memset begins already at position bc in buf,
> which means that the last position in buf to be memsetted is at position
> (bc + repeat - 1). *That* position must be < sizeof_buf - 1 to allow
> room for null-termination of buf.
Yes, I'm convinced - my walk through came up with the assertion ``bc +
repeat <= sizeof_buf - 1'' which is equivalent to your patch.
So approved.
Andrew
next prev parent reply other threads:[~2001-08-10 0:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-08 6:49 Orjan Friberg
2001-08-10 0:12 ` Andrew Cagney [this message]
2001-08-10 0:14 ` Daniel Jacobowitz
2001-08-10 0:28 ` Andrew Cagney
2001-08-10 3:14 ` Orjan Friberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B73891D.50209@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=orjan.friberg@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox