Skip to content

Commit ea7eccd

Browse files
authored
Merge pull request #1 from jarikomppa/master
Raknet - pull request #4
2 parents 7b55bb2 + ad7507c commit ea7eccd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Source/PacketizedTCP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ bool PacketizedTCP::SendList( const char **data, const unsigned int *lengths, co
8787
#endif
8888

8989

90-
unsigned int lengthsArray[512];
91-
const char *dataArray[512];
90+
unsigned int lengthsArray[513];
91+
const char *dataArray[513];
9292
dataArray[0]=(char*) &dataLength;
9393
lengthsArray[0]=sizeof(dataLength);
9494
for (int i=0; i < 512 && i < numParameters; i++)

Source/RakNetSocket2_Berkley_NativeClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void DomainNameToIP_Berkley_IPV4And6( const char *domainName, char ip[65] )
3333
hints.ai_socktype = SOCK_DGRAM;
3434

3535
if ((status = getaddrinfo(domainName, NULL, &hints, &res)) != 0) {
36-
memset(ip, 0, sizeof(ip));
36+
memset(ip, 0, 65); // sizeof(ip) returns pointer size, not array size
3737
return;
3838
}
3939

0 commit comments

Comments
 (0)