Skip to content

Commit d48b6f5

Browse files
committed
Add check to avoid crash
1 parent 957fde6 commit d48b6f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/modules/o365/userEnum.go

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ func CheckTenant(optionsInterface *interface{}, username string) bool {
2828
if len(options.validTenants) == 0 {
2929
options.validTenants = make(map[string]bool)
3030
}
31+
if len(strings.Split(username, "@")) == 1 {
32+
options.Log.Error("User should be in format [email protected]")
33+
return false
34+
}
3135
domain := strings.Split(username, "@")[1]
3236
// If we didn't already checked the domain
3337
options.Mutex.Lock()

0 commit comments

Comments
 (0)