From: Timo Sirainen Date: Mon, 24 Aug 2009 20:44:03 +0000 (-0400) Subject: auth: Don't crash at startup if auth socket name doesn't contain "-". X-Git-Tag: 2.0.alpha1~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d521180732e086173d08d01e205fe3a8c232418;p=thirdparty%2Fdovecot%2Fcore.git auth: Don't crash at startup if auth socket name doesn't contain "-". --HG-- branch : HEAD --- diff --git a/src/auth/main.c b/src/auth/main.c index 7dbcb65caa..52e14f8e43 100644 --- a/src/auth/main.c +++ b/src/auth/main.c @@ -141,7 +141,9 @@ static void client_connected(const struct master_service_connection *conn) } suffix = strrchr(sa.sun_path, '-'); - if (strcmp(suffix, "master") == 0) + if (suffix == NULL) + *type = AUTH_SOCKET_CLIENT; + else if (strcmp(suffix, "master") == 0) *type = AUTH_SOCKET_MASTER; else if (strcmp(suffix, "userdb") == 0) *type = AUTH_SOCKET_USERDB;