On 30 April 2015 at 01:00, Garrett Cooper <yaneurab...@gmail.com> wrote:
> On Apr 29, 2015, at 15:19, Mariusz Zaborski <osho...@freebsd.org> wrote: > > > Author: oshogbo > > Date: Wed Apr 29 22:19:40 2015 > > New Revision: 282252 > > URL: https://svnweb.freebsd.org/changeset/base/282252 > > > > Log: > > Remove the use of nvlist_.*[vf] functions from libcapsicum and replace > > them with snprintf(3). Assert the results of snprintf(3). > > > > Approved by: pjd (mentor) > > assert(3) can be compiled out with NDEBUG, causing memory > corruption on memory allocation failure or snprintf-related failure. Is > using assert a good idea? > Thanks! > -NGie > In my opinion it's only sanitary check for developers. We not assume that snprintf(3) will fail in those condition - buffer is far bigger then max value stored there (name (4) + MAX_UINT (21) = 25, buffer is declared 64). But it could fail if some developer will change the name of the variable and forgot to resize the array. So like I say it's only sanitary check. Thanks, Mariusz Zaborski _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"