Re: [Qemu-devel] [PATCH] fsdev: Fix overrun after readlink() fills buffer completely

2014-02-25 Thread Aneesh Kumar K.V
Markus Armbruster writes: > readlink() returns the number of bytes written to the buffer, and it > doesn't write a terminating null byte. do_readlink() writes it > itself. Overruns the buffer when readlink() filled it completely. > > Fix by reserving space for the null byte when calling readlin

[Qemu-devel] [PATCH] fsdev: Fix overrun after readlink() fills buffer completely

2014-02-21 Thread Markus Armbruster
readlink() returns the number of bytes written to the buffer, and it doesn't write a terminating null byte. do_readlink() writes it itself. Overruns the buffer when readlink() filled it completely. Fix by reserving space for the null byte when calling readlink(), like we do elsewhere. Signed-of