[libvirt] [PATCH] virlogd: fix crash if log file exists and it's larger the maxlen

Pavel Hrdina phrdina at redhat.com
Mon Nov 30 08:10:10 UTC 2015


On Mon, Nov 30, 2015 at 08:50:16AM +0100, Martin Kletzander wrote:
> On Mon, Nov 30, 2015 at 08:31:15AM +0100, Pavel Hrdina wrote:
> >If for some reason there is an existing log file, that is larger then
> >max length of log file, we need to rollover that file immediately.
> >Trying to figure out how much data we could write will resolve in
> >overflow of unsigned variable 'towrite' and this leads to segfault.
> >
> >Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> >---
> > src/util/virrotatingfile.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> 
> Makes sense, ACK.  Would you care to add a test in the
> tests/virrotatingfiletest.c file?  Thanks.

Sure, I'll add a test too, thanks.




More information about the libvir-list mailing list