Commit a0975ff3e932d21091f6e668e443d3f966f14009

Authored by Georg Hopp
1 parent 23ecc0b4

small buffer size related fix

... ... @@ -89,8 +89,8 @@ static
89 89 TR_RemoteData
90 90 tcpSocketRecv(TR_Socket this, size_t size)
91 91 {
  92 + unsigned char buffer[size = size>8192 ? 8192 : size];
92 93 TR_RemoteData rdata = NULL;
93   - unsigned char buffer[size];
94 94 ssize_t received;
95 95
96 96 received = recv(this->handle, buffer, size, this->flags);
... ...
... ... @@ -51,7 +51,7 @@ static
51 51 TR_RemoteData
52 52 udpSocketRecv(TR_Socket this, size_t size)
53 53 {
54   - unsigned char buffer[size>8192 ? 8192 : size];
  54 + unsigned char buffer[size = size>8192 ? 8192 : size];
55 55 ssize_t received;
56 56 TR_RemoteData rdata;
57 57 TR_Socket remote = TR_new(TR_UdpSocket, this->log, NULL, 0, 0);
... ... @@ -63,7 +63,7 @@ udpSocketRecv(TR_Socket this, size_t size)
63 63 buffer,
64 64 size,
65 65 this->flags,
66   - (struct sockaddr *)&(remote->addr),
  66 + &(remote->addr.info),
67 67 &remote->addrlen);
68 68
69 69 if (-1 == received) {
... ...
Please register or login to post a comment