In the ABI shim for vfs.bufspace, rather than truncating values larger than
INT_MAX to INT_MAX, just go ahead and write out the full long to give an error of ENOMEM to the user process. Requested by: bde
This commit is contained in:
parent
e7929cb0bc
commit
c8dd604fc2
@ -287,7 +287,10 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS)
|
||||
if (sizeof(int) == sizeof(long) || req->oldlen == sizeof(long))
|
||||
return (sysctl_handle_long(oidp, arg1, arg2, req));
|
||||
lvalue = *(long *)arg1;
|
||||
ivalue = lvalue > INT_MAX ? INT_MAX : lvalue;
|
||||
if (lvalue > INT_MAX)
|
||||
/* On overflow, still write out a long to trigger ENOMEM. */
|
||||
return (sysctl_handle_long(oidp, &lvalue, 0, req));
|
||||
ivalue = lvalue;
|
||||
return (sysctl_handle_int(oidp, &ivalue, 0, req));
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user