Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2014 16:08:42 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273740 - head/sys/netinet/cc
Message-ID:  <201410271608.s9RG8gxm046741@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Oct 27 16:08:41 2014
New Revision: 273740
URL: https://svnweb.freebsd.org/changeset/base/273740

Log:
  Preserve limitation of "TCP_CA_NAME_MAX" when matching the algorithm
  name.
  
  MFC after:	3 days
  Suggested by:	gnn @

Modified:
  head/sys/netinet/cc/cc.c

Modified: head/sys/netinet/cc/cc.c
==============================================================================
--- head/sys/netinet/cc/cc.c	Mon Oct 27 15:50:47 2014	(r273739)
+++ head/sys/netinet/cc/cc.c	Mon Oct 27 16:08:41 2014	(r273740)
@@ -107,7 +107,8 @@ cc_default_algo(SYSCTL_HANDLER_ARGS)
 		CC_LIST_RLOCK();
 		STAILQ_FOREACH(funcs, &cc_list, entries) {
 			/* NOTE: "newptr" is not zero terminated */
-			if (req->newlen != strlen(funcs->name))
+			if (req->newlen != strnlen(funcs->name,
+			    TCP_CA_NAME_MAX - 1))
 				continue;
 			if (bcmp(req->newptr, funcs->name, req->newlen))
 				continue;



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