MM-17607: large [brand, team, profile] images crash the server (#11827)

Этот коммит содержится в:
Lev
2019-08-08 14:23:37 -07:00
коммит произвёл Martin Kraft
родитель 3056b192fe
Коммит 4cd9fdf641
3 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@@ -39,7 +39,7 @@ func (a *App) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError {
}
if config.Width*config.Height > model.MaxImageSize {
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, "", http.StatusBadRequest)
}
file.Seek(0, 0)

Просмотреть файл

@@ -1361,7 +1361,7 @@ func (a *App) SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.decode_config.app_error", nil, err.Error(), http.StatusBadRequest)
}
if config.Width*config.Height > model.MaxImageSize {
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
return model.NewAppError("SetTeamIcon", "api.team.set_team_icon.too_large.app_error", nil, "", http.StatusBadRequest)
}
file.Seek(0, 0)

Просмотреть файл

@@ -867,7 +867,7 @@ func (a *App) SetProfileImageFromMultiPartFile(userId string, file multipart.Fil
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.decode_config.app_error", nil, err.Error(), http.StatusBadRequest)
}
if config.Width*config.Height > model.MaxImageSize {
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, err.Error(), http.StatusBadRequest)
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.too_large.app_error", nil, "", http.StatusBadRequest)
}
file.Seek(0, 0)