mksnap_ffs segfaults (was: Re: svn commit: r193051 - head/sbin/mksnap_ffs)

Lucius Windschuh lwindschuh at googlemail.com
Tue Jun 2 07:26:54 UTC 2009


2009/5/29 Pawel Jakub Dawidek <pjd at 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


More information about the freebsd-current mailing list