Re: [PATCH] vnc: avoid underflow when accessing user-provided address

2023-04-21 Thread Vladimir Sementsov-Ogievskiy
On 30.03.23 15:44, Paolo Bonzini wrote: 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 cou

Re: [PATCH] vnc: avoid underflow when accessing user-provided address

2023-03-30 Thread Philippe Mathieu-Daudé
On 30/3/23 14:44, Paolo Bonzini wrote: 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 coul

[PATCH] vnc: avoid underflow when accessing user-provided address

2023-03-30 Thread Paolo Bonzini
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 checkin