use snprintf (actually, "addr" can be supplied from outside, and if "addr"

points to shorter-than-24 buffer we will overrun buffer.  bad API)
This commit is contained in:
itojun 2003-07-24 04:41:13 +00:00
parent f8d975a54e
commit 0f3017142e

View File

@ -691,7 +691,7 @@ int BIO_accept(int sock, char **addr)
}
*addr=p;
}
sprintf(*addr,"%d.%d.%d.%d:%d",
snprintf(*addr,24,"%d.%d.%d.%d:%d",
(unsigned char)(l>>24L)&0xff,
(unsigned char)(l>>16L)&0xff,
(unsigned char)(l>> 8L)&0xff,