Skip to content

Commit

Permalink
lib-imap-urlauth: Fix segfault occurring when userid part is missing …
Browse files Browse the repository at this point in the history
…for "user+" or "submit+" URLAUTH access.
  • Loading branch information
stephanbosch authored and sirainen committed Feb 1, 2018
1 parent f8d9e6c commit 8c1202f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib-imap-urlauth/imap-urlauth.c
Expand Up @@ -165,6 +165,10 @@ imap_urlauth_check_access(struct imap_urlauth_context *uctx,
/* these access types are only allowed if URL is accessed through imap */
if (strcasecmp(url->uauth_access_application, "user") == 0) {
/* user+<access_user> */
if (url->uauth_access_user == NULL) {
*error_r = "URLAUTH `user' access is missing userid";
return FALSE;
}
if (!uctx->access_anonymous ||
strcasecmp(url->uauth_access_user, uctx->access_user) == 0)
return TRUE;
Expand All @@ -189,6 +193,9 @@ imap_urlauth_check_access(struct imap_urlauth_context *uctx,
"No '%s%s' access allowed for submission service",
url->uauth_access_application, userid);
return FALSE;
} else if (url->uauth_access_user == NULL) {
*error_r = "URLAUTH `submit' access is missing userid";
return FALSE;
} else if (!uctx->access_anonymous &&
strcasecmp(url->uauth_access_user, uctx->access_user) == 0) {
return TRUE;
Expand Down

0 comments on commit 8c1202f

Please sign in to comment.