Re: [libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Cole Robinson
On 09/01/2010 04:38 PM, Eric Blake wrote: > On 09/01/2010 01:43 PM, Cole Robinson wrote: >> The current code will go into an infinite loop if the printf generated >> string is>= 1000, AND exactly 1 character smaller than the amount of free >> space in the buffer. When this happens, we are dropped i

Re: [libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Eric Blake
On 09/01/2010 01:43 PM, Cole Robinson wrote: The current code will go into an infinite loop if the printf generated string is>= 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually change

[libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Cole Robinson
The current code will go into an infinite loop if the printf generated string is >= 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually change, because count == (buf->size - buf->use - 1),