Conn_SetPassword( CONN_ID Idx, const char *Pwd )
{
assert( Idx > NONE );
- strlcpy( My_Connections[Idx].pwd, Pwd,
- sizeof(My_Connections[Idx].pwd) );
+ My_Connections[Idx].pwd = calloc(strlen(Pwd) + 1, sizeof(char));
+ if (My_Connections[Idx].pwd == NULL) {
+ Log(LOG_EMERG, "Can't allocate memory! [Conn_SetPassword]");
+ exit(1);
+ }
+ strcpy( My_Connections[Idx].pwd, Pwd );
} /* Conn_SetPassword */
/**
array_free(&My_Connections[Idx].rbuf);
array_free(&My_Connections[Idx].wbuf);
+ if (My_Connections[Idx].pwd != NULL)
+ free(My_Connections[Idx].pwd);
/* Clean up connection structure (=free it) */
Init_Conn_Struct( Idx );
ng_ipaddr_t addr; /* Client address */
PROC_STAT proc_stat; /* Status of resolver process */
char host[HOST_LEN]; /* Hostname */
- char pwd[CLIENT_PASS_LEN]; /* password received of the client */
+ char *pwd; /* password received of the client */
array rbuf; /* Read buffer */
array wbuf; /* Write buffer */
time_t signon; /* Signon ("connect") time */