Fix regression issue after r267961. Handle special string case for

SYSCTLs like previously.

MFC after:	2 weeks
Reported by:	several people
This commit is contained in:
Hans Petter Selasky 2014-06-28 03:59:04 +00:00
parent af3b2549c4
commit 6a3287f889

View File

@ -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;