From 4cd9fdf64122f429b742921b8e265623df2be90d Mon Sep 17 00:00:00 2001 From: Lev <1187448+levb@users.noreply.github.com> Date: Thu, 8 Aug 2019 14:23:37 -0700 Subject: [PATCH] MM-17607: large [brand, team, profile] images crash the server (#11827) --- app/brand.go | 2 +- app/team.go | 2 +- app/user.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/brand.go b/app/brand.go index 6c1091fffc..b643842d1c 100644 --- a/app/brand.go +++ b/app/brand.go @@ -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) diff --git a/app/team.go b/app/team.go index efae735732..a9bf8ac05b 100644 --- a/app/team.go +++ b/app/team.go @@ -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) diff --git a/app/user.go b/app/user.go index b04ee80243..4df91b577a 100644 --- a/app/user.go +++ b/app/user.go @@ -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)