Re: [rfc] Fix qC handling in gdbserver

Pedro Alves
2007-04-27T10:27:56Z

On 4/27/07, Markus Deuling wrote:
> + /* Reply the current thread id. */
> + if (own_buf[0] == 'q' && own_buf[1] == 'C')
> + {

All the other tests in the function seem to check for an
extra '\0', ',' or ':' after the query name. Shouldn't you do the
same here? Otherwise you are answering
to all future queries starting with qC (Think or a gdbserver
installed in rom in a board in the field, and connecting
to it with gdb-cvs2020 :) )

something like:

> + if (strcmp (own_buf, "qC") == 0)

or

> + if (own_buf[0] == 'q' && own_buf[1] == 'C'&& own_buf[2] == '\0')

?

Cheers,
Pedro Alves