Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Bin Chen <binary.chen@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb@sourceware.org
Subject: Re: (len % 1) != 0
Date: Sun, 17 Feb 2008 15:26:00 -0000	[thread overview]
Message-ID: <20080217152625.GA4810@caradoc.them.org> (raw)
In-Reply-To: <5800c1cc0802170641g68ab2e5fte724cd076412333@mail.gmail.com>

On Sun, Feb 17, 2008 at 10:41:36PM +0800, Bin Chen wrote:
> Hi Daniel,
> 
> Is it a bug?

Yes.  Fixed as below.

-- 
Daniel Jacobowitz
CodeSourcery

2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>

	* server.c (handle_query): Correct length check.

Index: server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.64
diff -u -p -r1.64 server.c
--- server.c	14 Feb 2008 16:42:55 -0000	1.64
+++ server.c	17 Feb 2008 15:25:22 -0000
@@ -649,7 +649,7 @@ handle_query (char *own_buf, int packet_
       char *mon = malloc (PBUFSIZ);
       int len = strlen (own_buf + 6);
 
-      if ((len % 1) != 0 || unhexify (mon, own_buf + 6, len / 2) != len / 2)
+      if ((len % 2) != 0 || unhexify (mon, own_buf + 6, len / 2) != len / 2)
 	{
 	  write_enn (own_buf);
 	  free (mon);


  reply	other threads:[~2008-02-17 15:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17  5:57 Bin Chen
2008-02-17 14:13 ` Eli Zaretskii
2008-02-17 14:41   ` Bin Chen
2008-02-17 15:26     ` Daniel Jacobowitz [this message]
2008-02-19 16:32       ` Sheng-Liang Song
2008-02-19 18:25         ` Dave Korn
2008-02-19 18:30           ` David Daney
     [not found]           ` <18363.7810.91075.314867@gargle.gargle.HOWL>
2008-02-19 18:35             ` Dave Korn
2008-02-19 18:47               ` David Daney
2008-02-19 18:49                 ` Daniel Jacobowitz
2008-02-19 19:08                 ` Dave Korn
2008-02-19 21:41           ` Andreas Schwab

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=20080217152625.GA4810@caradoc.them.org \
    --to=drow@false.org \
    --cc=binary.chen@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    /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