comparison src/director/login-connection.c @ 17467:899cf87a687c

director: Fixed crash if master_user_separator is set, but we didn't do a proxy lookup. Found by Coverity
author Timo Sirainen <tss@iki.fi>
date Fri, 13 Jun 2014 00:57:06 +0300
parents add8c00fb3cc
children a7e830b9b967
comparison
equal deleted inserted replaced
17466:800a28db8116 17467:899cf87a687c
145 else if (strncmp(*args, "user=", 5) == 0) { 145 else if (strncmp(*args, "user=", 5) == 0) {
146 if (username == NULL) 146 if (username == NULL)
147 username = *args + 5; 147 username = *args + 5;
148 } 148 }
149 } 149 }
150 if (!proxy || host || username == NULL) {
151 login_connection_send_line(conn, line);
152 return;
153 }
150 if (*conn->dir->set->master_user_separator != '\0') { 154 if (*conn->dir->set->master_user_separator != '\0') {
151 /* with master user logins we still want to use only the 155 /* with master user logins we still want to use only the
152 login username */ 156 login username */
153 username = t_strcut(username, 157 username = t_strcut(username,
154 *conn->dir->set->master_user_separator); 158 *conn->dir->set->master_user_separator);
155 }
156
157 if (!proxy || host || username == NULL) {
158 login_connection_send_line(conn, line);
159 return;
160 } 159 }
161 160
162 /* we need to add the host. the lookup might be asynchronous */ 161 /* we need to add the host. the lookup might be asynchronous */
163 request = i_new(struct login_host_request, 1); 162 request = i_new(struct login_host_request, 1);
164 request->conn = conn; 163 request->conn = conn;