Evgeny Grin commented on a discussion on lib/system/sockets.c:
100 |
+ bufs[to_send_cnt].buf = iovec[to_send_cnt].iov_base;
|
|
101 |
+ bufs[to_send_cnt].len = (unsigned long)
|
|
102 |
+ (space_left > ULONG_MAX ?
|
|
103 |
+ ULONG_MAX : space_left);
|
|
104 |
+ ovrflwn = true;
|
|
105 |
+ }
|
|
106 |
+ else if (iovec[to_send_cnt].iov_len > ULONG_MAX) {
|
|
107 |
+ bufs[to_send_cnt].buf = iovec[to_send_cnt].iov_base;
|
|
108 |
+ bufs[to_send_cnt].len = ULONG_MAX;
|
|
109 |
+ ovrflwn = true;
|
|
110 |
+ }
|
|
111 |
+ else {
|
|
112 |
+ bufs[to_send_cnt].buf = iovec[to_send_cnt].iov_base;
|
|
113 |
+ bufs[to_send_cnt].len =
|
|
114 |
+ (unsigned long) iovec[to_send_cnt].iov_len;
|
|
115 |
+ to_send_bytes += iovec[to_send_cnt].iov_len;
|
WSASend()
can send more than SSIZE_MAX
on x32 Windows. The problem is GnuTLS will unable to process this value, as return value could be negative when casted to ssize_t
.