Only use the ABI compat shim for vfs.bufspace if the old buffer is smaller

than a long.

PR:		amd64/134786
Submitted by:	Emil Mikulic  emikulic| gmail
MFC after:	3 days
This commit is contained in:
jhb 2009-05-21 16:18:45 +00:00
parent fe8ccf4f67
commit 35ba8bce41

View File

@ -293,7 +293,7 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS)
long lvalue;
int ivalue;
if (sizeof(int) == sizeof(long) || req->oldlen == sizeof(long))
if (sizeof(int) == sizeof(long) || req->oldlen >= sizeof(long))
return (sysctl_handle_long(oidp, arg1, arg2, req));
lvalue = *(long *)arg1;
if (lvalue > INT_MAX)