[CRIU] [PATCH] prepare_pstree: fixup reading kernel pid_max

Laurent Dufour ldufour at linux.vnet.ibm.com
Wed Aug 17 03:03:02 PDT 2016


On 04/08/2016 03:04, Kir Kolyshkin wrote:
> Two fixes (reported by coverity) and a minor nitpick:
> 
> 1. Fix checking error from open_proc().
> 
> 2. Fix buffer overflow. MAX_ULONG can be 20 characters long, so
> ret = read() can return 20 and buf[ret] = 0 will overrun the buf.
> Make a buf one character longer (an extra byte for \0) and pass
> sizeof(buf) - 1 to read to fix it.

Thanks for fixing my mistakes !

Acked-by: Laurent Dufour <ldufour at linux.vnet.ibm.com>



More information about the CRIU mailing list