From owner-svn-src-head@FreeBSD.ORG Wed Apr 29 23:08:44 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5960321B; Wed, 29 Apr 2015 23:08:44 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E456814AF; Wed, 29 Apr 2015 23:08:43 +0000 (UTC) Received: by wicmx19 with SMTP id mx19so550013wic.1; Wed, 29 Apr 2015 16:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Tb4aprbx89bZox1E7DCS5NWPd1gq5RhjQxEp4ZduVPA=; b=sRwLXfuo8Wc79KZNzjva7NXdMkJd0rG44XXj6jHekeougtCQyakWMLKetPTTNV7aE2 T/wAV58Avs2SR+Ml72P8VvpP0SkYr4wLkh9vHrQKA798hwsVoevl2hOgA6irVmeS0cz9 DqfOL5B4aawaNbv8j50RIBzYnHomtiLYOt/AhOqg8Nlda27HsaJ+V7XEDF0UHDb7igTw q5YYPf2E2muHrGCDk+IhWZsVmn8W8w+JOm5FdqtKLV3QmCH8Pg/6DJ+3rjdnYtmfRcSs cIOUyDHDKG0ps1GU/rwdBXMTeejUxkzrf7Xy1iIYGdLqo+wHjwEgM+gjfQmDVTKigizM LwUQ== MIME-Version: 1.0 X-Received: by 10.180.78.65 with SMTP id z1mr67600wiw.14.1430348922381; Wed, 29 Apr 2015 16:08:42 -0700 (PDT) Sender: oshogbo.vx@gmail.com Received: by 10.28.187.214 with HTTP; Wed, 29 Apr 2015 16:08:42 -0700 (PDT) In-Reply-To: <8E2140D8-E008-4A9D-A628-1FA4693A8797@gmail.com> References: <201504292219.t3TMJeGn071528@svn.freebsd.org> <8E2140D8-E008-4A9D-A628-1FA4693A8797@gmail.com> Date: Thu, 30 Apr 2015 01:08:42 +0200 X-Google-Sender-Auth: NOkAjeUgIUIDOD2j_6ewTrUza5c Message-ID: Subject: Re: svn commit: r282252 - head/lib/libcapsicum From: Mariusz Zaborski To: Garrett Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 23:08:44 -0000 On 30 April 2015 at 01:00, Garrett Cooper wrote: > On Apr 29, 2015, at 15:19, Mariusz Zaborski 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