Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 2015 21:11:08 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278815 - head/lib/libc/gen
Message-ID:  <201502152111.t1FLB8MQ059069@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Feb 15 21:11:07 2015
New Revision: 278815
URL: https://svnweb.freebsd.org/changeset/base/278815

Log:
  Replace strcpy() with strlcpy()
  
  The risk of an overrun here is very low but check the
  length, JIC.
  
  CID:	1019039

Modified:
  head/lib/libc/gen/fstab.c

Modified: head/lib/libc/gen/fstab.c
==============================================================================
--- head/lib/libc/gen/fstab.c	Sun Feb 15 21:03:49 2015	(r278814)
+++ head/lib/libc/gen/fstab.c	Sun Feb 15 21:11:07 2015	(r278815)
@@ -181,7 +181,7 @@ fstabscan(void)
 			if (cp != NULL)
 				_fs_fstab.fs_passno = atoi(cp);
 		}
-		strcpy(subline, _fs_fstab.fs_mntops);
+		(void)strlcpy(subline, _fs_fstab.fs_mntops, sizeof(subline));
 		p = subline;
 		for (typexx = 0, cp = strsep(&p, ","); cp;
 		     cp = strsep(&p, ",")) {



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