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:
parent
f8d975a54e
commit
0f3017142e
2
crypto/dist/openssl/crypto/bio/b_sock.c
vendored
2
crypto/dist/openssl/crypto/bio/b_sock.c
vendored
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user