Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2014 03:59:04 +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: r267993 - head/sys/kern
Message-ID:  <201406280359.s5S3x4xV098857@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sat Jun 28 03:59:04 2014
New Revision: 267993
URL: http://svnweb.freebsd.org/changeset/base/267993

Log:
  Fix regression issue after r267961. Handle special string case for
  SYSCTLs like previously.
  
  MFC after:	2 weeks
  Reported by:	several people

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Sat Jun 28 03:56:17 2014	(r267992)
+++ head/sys/kern/kern_sysctl.c	Sat Jun 28 03:59:04 2014	(r267993)
@@ -1210,9 +1210,12 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS
 	size_t outlen;
 	int error = 0;
 
-	/* check for zero-length buffer */
+	/*
+	 * A zero-length buffer indicates a fixed size read-only
+	 * string:
+	 */
 	if (arg2 == 0)
-		return (ENOMEM);
+		arg2 = strlen((char *)arg1) + 1;
 
 	if (req->oldptr != NULL) {
 		char *tmparg;



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