Skip to content

Commit

Permalink
Merge pull request #1 from jarikomppa/master
Browse files Browse the repository at this point in the history
Raknet - pull request #4
  • Loading branch information
Luke1410 committed Jul 31, 2017
2 parents 7b55bb2 + ad7507c commit ea7eccd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/PacketizedTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ bool PacketizedTCP::SendList( const char **data, const unsigned int *lengths, co
#endif


unsigned int lengthsArray[512];
const char *dataArray[512];
unsigned int lengthsArray[513];
const char *dataArray[513];
dataArray[0]=(char*) &dataLength;
lengthsArray[0]=sizeof(dataLength);
for (int i=0; i < 512 && i < numParameters; i++)
Expand Down
2 changes: 1 addition & 1 deletion Source/RakNetSocket2_Berkley_NativeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void DomainNameToIP_Berkley_IPV4And6( const char *domainName, char ip[65] )
hints.ai_socktype = SOCK_DGRAM;

if ((status = getaddrinfo(domainName, NULL, &hints, &res)) != 0) {
memset(ip, 0, sizeof(ip));
memset(ip, 0, 65); // sizeof(ip) returns pointer size, not array size

This comment has been minimized.

Copy link
@pps83

pps83 Oct 15, 2017

this doesn't make sense. should be ip[0] = '\0';
there is similar code in some other RakNetSocket2_xxx file that does 65*sizeof(char)

This comment has been minimized.

Copy link
@Luke1410

Luke1410 Oct 17, 2017

Author Member

good catch - corrected in master / expected to get corrected/changes in SLikeNet 0.1.1

return;
}

Expand Down

0 comments on commit ea7eccd

Please sign in to comment.