Date: Mon, 6 Feb 2012 17:31:13 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r231090 - stable/7/sys/fs/pseudofs Message-ID: <201202061731.q16HVDL1046200@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jh Date: Mon Feb 6 17:31:13 2012 New Revision: 231090 URL: http://svn.freebsd.org/changeset/base/231090 Log: MFC r229692: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:28:55 2012 (r231089) +++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c Mon Feb 6 17:31:13 2012 (r231090) @@ -805,7 +805,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202061731.q16HVDL1046200>