tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: recent sysctl changes



On Fri, Mar 07, 2014 at 10:49:54AM +0200, Andreas Gustafsson wrote:
> 
> An application could, for example, maintain a single, shared,
> malloc'ed buffer that is reused for multiple sysctl() calls and only
> resized on ENOMEM returns.  IMO, this is allowed by the API, but with
> your change, a read of a CTLTYPE_QUAD variable will return the wrong
> result if the buffer happened to be left with a size of 4 by a
> previous read of a CTLTYPE_INT variable.

But such a program would already have been buggy -- you can't read CTLTYPE_QUAD
into a buffer of size 4.

Thor


Home | Main Index | Thread Index | Old Index