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

From: Lucius Windschuh <lwindschuh_at_googlemail.com>
Date: Tue, 2 Jun 2009 09:26:53 +0200
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)
_at__at_ -66,8 +66,8 _at__at_
        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
Received on Tue Jun 02 2009 - 05:26:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:49 UTC