Searched hist:"3 f9c41c5df9617510d8533cf6588172efb3df34b" (Results 1 – 1 of 1) sorted by relevance
/openbmc/qemu/ui/ |
H A D | vnc.c | diff 3f9c41c5df9617510d8533cf6588172efb3df34b Thu Mar 30 07:23:40 CDT 2023 Paolo Bonzini <pbonzini@redhat.com> vnc: avoid underflow when accessing user-provided address
If hostlen is zero, there is a possibility that addrstr[hostlen - 1] underflows and, if a closing bracked is there, hostlen - 2 is passed to g_strndup() on the next line. If websocket==false then addrstr[0] would be a colon, but if websocket==true this could in principle happen.
Fix it by checking hostlen.
Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|