Fixed yet another remote buffer overflow.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2337 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
285f6e6ca8
commit
997fa53005
1 changed files with 5 additions and 2 deletions
|
@ -448,7 +448,7 @@ qboolean NET_StringToSockaddr (char *s, struct sockaddr_qstorage *sadr)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifdef IPPROTO_IPV6
|
#ifdef IPPROTO_IPV6
|
||||||
if (pgetaddrinfo)
|
if (pgetaddrinfo)
|
||||||
{
|
{
|
||||||
struct addrinfo *addrinfo = NULL;
|
struct addrinfo *addrinfo = NULL;
|
||||||
struct addrinfo *pos;
|
struct addrinfo *pos;
|
||||||
|
@ -531,6 +531,9 @@ dblbreak:
|
||||||
|
|
||||||
((struct sockaddr_in *)sadr)->sin_port = 0;
|
((struct sockaddr_in *)sadr)->sin_port = 0;
|
||||||
|
|
||||||
|
if (strlen(s) >= sizeof(copy)-1)
|
||||||
|
return false;
|
||||||
|
|
||||||
strcpy (copy, s);
|
strcpy (copy, s);
|
||||||
// strip off a trailing :port if present
|
// strip off a trailing :port if present
|
||||||
for (colon = copy ; *colon ; colon++)
|
for (colon = copy ; *colon ; colon++)
|
||||||
|
|
Loading…
Reference in a new issue