From owner-svn-src-head@FreeBSD.ORG Wed Dec 5 13:56:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82517525; Wed, 5 Dec 2012 13:56:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 689C28FC12; Wed, 5 Dec 2012 13:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB5DurEQ068386; Wed, 5 Dec 2012 13:56:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB5DurOH068385; Wed, 5 Dec 2012 13:56:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201212051356.qB5DurOH068385@svn.freebsd.org> From: Eitan Adler Date: Wed, 5 Dec 2012 13:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243897 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 05 Dec 2012 13:56:53 -0000 Author: eadler Date: Wed Dec 5 13:56:52 2012 New Revision: 243897 URL: http://svnweb.freebsd.org/changeset/base/243897 Log: Avoid overflowing the file buffer Submitted by: db Approved by: cperciva MFC after: 2 weeks Modified: head/usr.sbin/pw/rm_r.c Modified: head/usr.sbin/pw/rm_r.c ============================================================================== --- head/usr.sbin/pw/rm_r.c Wed Dec 5 13:56:49 2012 (r243896) +++ head/usr.sbin/pw/rm_r.c Wed Dec 5 13:56:52 2012 (r243897) @@ -52,7 +52,7 @@ rm_r(char const * dir, uid_t uid) while ((e = readdir(d)) != NULL) { if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0) { - sprintf(file, "%s/%s", dir, e->d_name); + snprintf(file, sizeof(file), "%s/%s", dir, e->d_name); if (lstat(file, &st) == 0) { /* Need symlinks, not * linked file */ if (S_ISDIR(st.st_mode)) /* Directory - recurse */