gdbstub: avoid possible NULL pointer dereference
commit3d0f44189178aab3a21a33ecf6a113b9abaea2bc
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Mar 2015 12:26:58 +0000 (2 13:26 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 10 Mar 2015 05:15:34 +0000 (10 08:15 +0300)
tree467b8b699bbe644ac4e60a624ed3d905ca272444
parentc6dc3dd72b747a057770087998a1f9ef0b3f1882
gdbstub: avoid possible NULL pointer dereference

Coverity reports that s->chr is checked after put_packet dereferences it.
Move the check earlier, consistent with the code used for user-mode
emulation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
gdbstub.c