MFC r208671: udf_readlink: fix malloc call with uninitialized size

parameter

Found by:	clang static analyzer
Approved by:	re(kib)
This commit is contained in:
Andriy Gapon 2010-06-09 10:13:59 +00:00
parent 2549d17a08
commit d52023c1d3

View File

@ -904,9 +904,9 @@ udf_readlink(struct vop_readlink_args *ap)
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;