mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Expand ip char buffers which are too small for v6.
Increase the size of character buffers being used to store printable IP addresses so that they can safely store IPv6 addresses.
This commit is contained in:
parent
f7d9a92d4e
commit
96b02dc055
@ -1128,7 +1128,7 @@ void getClientsMaxBuffers(unsigned long *longest_output_list,
|
|||||||
|
|
||||||
/* Turn a Redis client into an sds string representing its state. */
|
/* Turn a Redis client into an sds string representing its state. */
|
||||||
sds getClientInfoString(redisClient *client) {
|
sds getClientInfoString(redisClient *client) {
|
||||||
char ip[32], flags[16], events[3], *p;
|
char ip[REDIS_IP_STR_LEN], flags[16], events[3], *p;
|
||||||
int port = 0; /* initialized to zero for the unix socket case. */
|
int port = 0; /* initialized to zero for the unix socket case. */
|
||||||
int emask;
|
int emask;
|
||||||
|
|
||||||
@ -1210,7 +1210,8 @@ void clientCommand(redisClient *c) {
|
|||||||
} else if (!strcasecmp(c->argv[1]->ptr,"kill") && c->argc == 3) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"kill") && c->argc == 3) {
|
||||||
listRewind(server.clients,&li);
|
listRewind(server.clients,&li);
|
||||||
while ((ln = listNext(&li)) != NULL) {
|
while ((ln = listNext(&li)) != NULL) {
|
||||||
char ip[32], addr[64];
|
/* addr size 64 > INET6_ADDRSTRLEN + : + strlen("65535") */
|
||||||
|
char ip[INET6_ADDRSTRLEN], addr[64];
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
client = listNodeValue(ln);
|
client = listNodeValue(ln);
|
||||||
|
Loading…
Reference in New Issue
Block a user