On 4 February 2015 at 13:36, Pedro Alves <pal...@redhat.com> wrote: > > This looks like it'd mishandle a future qAttached2 packet. > > It should be doing something like: > > if (strncmp(p, "Attached", 8) == 0 && > (p[8] == '\0' || p[8] == ':')) { > > or: > > if (strcmp(p, "Attached") == 0 || strncmp(p, "Attached:", 9) == 0) { > > > Likewise other packets, if they have the same issue. > (I'm not familiar with qemu's stub's internals.)
Looks like we get this wrong for a lot of our existing query packet handling too... Maybe worth having a utility function for "is this a foo query packet" rather than raw strcmp/strncmp? -- PMM