Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2010 10:14:00 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r208941 - stable/8/sys/fs/udf
Message-ID:  <201006091014.o59AE0lI091207@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Jun  9 10:13:59 2010
New Revision: 208941
URL: http://svn.freebsd.org/changeset/base/208941

Log:
  MFC r208671: udf_readlink: fix malloc call with uninitialized size
  parameter
  
  Found by:	clang static analyzer
  Approved by:	re(kib)

Modified:
  stable/8/sys/fs/udf/udf_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/fs/udf/udf_vnops.c
==============================================================================
--- stable/8/sys/fs/udf/udf_vnops.c	Wed Jun  9 09:51:16 2010	(r208940)
+++ stable/8/sys/fs/udf/udf_vnops.c	Wed Jun  9 10:13:59 2010	(r208941)
@@ -904,9 +904,9 @@ udf_readlink(struct vop_readlink_args *a
 	vp = ap->a_vp;
 	node = VTON(vp);
 	len = le64toh(node->fentry->inf_len);
+	iov[0].iov_len = len;
 	buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK);
 	iov[0].iov_base = buf;
-	iov[0].iov_len = len;
 	uio.uio_iov = iov;
 	uio.uio_iovcnt = 1;
 	uio.uio_offset = 0;



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