Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jun 2009 09:26:53 +0200
From:      Lucius Windschuh <lwindschuh@googlemail.com>
To:        Pawel Jakub Dawidek <pjd@freebsd.org>, current@freebsd.org
Subject:   mksnap_ffs segfaults (was: Re: svn commit: r193051 -  head/sbin/mksnap_ffs)
Message-ID:  <90a5caac0906020026t67d7d9ej225565b42898a4b7@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
2009/5/29 Pawel Jakub Dawidek <pjd@freebsd.org>:
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?90a5caac0906020026t67d7d9ej225565b42898a4b7>