]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virlogd: fix crash if log file exists and it's larger the maxlen
authorPavel Hrdina <phrdina@redhat.com>
Sat, 28 Nov 2015 08:03:40 +0000 (09:03 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 30 Nov 2015 09:45:45 +0000 (10:45 +0100)
commitcb97426208b47ac9f5f376311407ce4ebd80858d
tree161a001a2fcad324c6f9d810cccc09ce08055422
parent163a781e63481499c6027beed017221e39ebdc0b
virlogd: fix crash if log file exists and it's larger the maxlen

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@redhat.com>
src/util/virrotatingfile.c
tests/virrotatingfiletest.c