-/* $Cambridge: exim/src/src/srs.c,v 1.6 2005/05/24 08:50:35 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
{
uschar *list = srs_config;
uschar secret_buf[SRS_MAX_SECRET_LENGTH];
- uschar *secret;
+ uschar *secret = NULL;
uschar sbuf[4];
uschar *sbufp;
/* First secret specified in secrets? */
co = 0;
list = srs_secrets;
- if(secret == NULL)
+ if(secret == NULL || *secret == '\0')
{
if((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) == NULL)
{
/* Extra secrets? */
while((secret = string_nextinlist(&list, &co, secret_buf, SRS_MAX_SECRET_LENGTH)) != NULL)
- srs_add_secret(srs, secret, strnlen(secret, SRS_MAX_SECRET_LENGTH));
+ srs_add_secret(srs, secret, (Ustrlen(secret) > SRS_MAX_SECRET_LENGTH) ? SRS_MAX_SECRET_LENGTH : Ustrlen(secret));
DEBUG(D_any)
debug_printf("SRS initialized\n");