Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Feb 2012 17:28:55 +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-8@freebsd.org
Subject:   svn commit: r231089 - stable/8/sys/fs/pseudofs
Message-ID:  <201202061728.q16HStdM046076@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Mon Feb  6 17:28:55 2012
New Revision: 231089
URL: http://svn.freebsd.org/changeset/base/231089

Log:
  MFC r229692:
  
  Check the return value of sbuf_finish() in pfs_readlink() and return
  ENAMETOOLONG if the buffer overflowed.

Modified:
  stable/8/sys/fs/pseudofs/pseudofs_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)

Modified: stable/8/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- stable/8/sys/fs/pseudofs/pseudofs_vnops.c	Mon Feb  6 17:00:28 2012	(r231088)
+++ stable/8/sys/fs/pseudofs/pseudofs_vnops.c	Mon Feb  6 17:28:55 2012	(r231089)
@@ -892,7 +892,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?201202061728.q16HStdM046076>