Re: [slabinfo PATCH] Fix off-by-one after readlink() call

From: David Rientjes
Date: Fri Oct 14 2011 - 15:53:38 EST


On Fri, 14 Oct 2011, Thomas Jarosch wrote:

> The problem is the line after the readlink() call:
>
> buffer[count] = '\0';
>
> The common technique is to reduce the buffer size by one.
> Another fix would be to check
>
> "
> if (count < 0 || count == sizeof(buffer))
> fatal();
> "
>
> Reducing the buffer size by one is easier IMHO.
>

I think this should be used for changelog.

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/