Steps to Reproduce
- Build mono in Linux or Android in gcc with -O2
- Test -> Socket.ReceiveBufferSize = 50000
- try a few more times
- You'll see random results
Current Behavior
Roll in 0-65535
Expected Behavior
be correct value
On which platforms did you notice this
[ ] macOS
[x ] Linux and android build by unity
[ ] Windows
Version Used:
all
Stacktrace
int _wapi_setsockopt(guint32 fd, int level, int optname,
const void *optval, socklen_t optlen)
{
....
* int bufsize = *((int *) optval); //is undefined behaviour
}