From owner-freebsd-current@FreeBSD.ORG Tue Jun 2 07:26:54 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DB4106566B; Tue, 2 Jun 2009 07:26:54 +0000 (UTC) (envelope-from lwindschuh@googlemail.com) Received: from mail-gx0-f211.google.com (mail-gx0-f211.google.com [209.85.217.211]) by mx1.freebsd.org (Postfix) with ESMTP id A0AB48FC0A; Tue, 2 Jun 2009 07:26:53 +0000 (UTC) (envelope-from lwindschuh@googlemail.com) Received: by gxk7 with SMTP id 7so863534gxk.19 for ; Tue, 02 Jun 2009 00:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=Pfad8qyzJgbYnkCuQteUdggTkrkUS8onhpQuiLLgSEY=; b=mIId7sVCQKVpbkrGPA2hRNBUAkbVtTzDYa1ANFsHfmXB618Wwr7kC1Y6YjKhWZAoTb IFN5WDyTX2wgV8f+wQoeJwC4/Sqn5TrQiVmX/udGpG9jEljJp+a8O/CIircif5F9sOA9 69pgggPK+abJ9x6JVwssqemZ0IMqHJLRusWz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=jB8BeBFVyyHoifVCNsUihMSh9v6lB6eLqHN0UssyiVvI8jiI2en+pvR+xQoZlew/qu U45pyPQB5+qSJN0hdU8H6uNQYJfmvFAla2ExItGqSX7x2RYr4pQkIzc8+hUo1tGVAETv MjJBzO8IAZqiK7j7b7MS5sLHbxyCFRj3LcDP0= MIME-Version: 1.0 Received: by 10.150.202.11 with SMTP id z11mr13645296ybf.0.1243927613138; Tue, 02 Jun 2009 00:26:53 -0700 (PDT) Date: Tue, 2 Jun 2009 09:26:53 +0200 Message-ID: <90a5caac0906020026t67d7d9ej225565b42898a4b7@mail.gmail.com> From: Lucius Windschuh To: Pawel Jakub Dawidek , current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: mksnap_ffs segfaults (was: Re: svn commit: r193051 - head/sbin/mksnap_ffs) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 07:26:54 -0000 2009/5/29 Pawel Jakub Dawidek : > Author: pjd > Date: Fri May 29 19:18:41 2009 > New Revision: 193051 > URL: http://svn.freebsd.org/changeset/base/193051 Hi Pawel. You forgot to initialize iov and iovlen. This makes mksnap_ffs crash on the first build_iovec() with malloc() debugging enabled. Index: src/sbin/mksnap_ffs/mksnap_ffs.c =================================================================== --- src/sbin/mksnap_ffs/mksnap_ffs.c (revision 193301) +++ src/sbin/mksnap_ffs/mksnap_ffs.c (working copy) @@ -66,8 +66,8 @@ struct statfs stfsbuf; struct group *grp; struct stat stbuf; - struct iovec *iov; - int fd, iovlen; + struct iovec *iov = NULL; + int fd, iovlen = 0; if (argc == 2) snapname = argv[1]; Lucius