From 23b83cb73669c98e66095aee2c37ac9d0cf97162 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 11 Jun 2017 02:28:08 -0400 Subject: pkg/process: fix potential race condition Following conditions were not protected: 1. Use and increase next pid 2. Append and remove process from the list --- models/action.go | 2 +- models/ssh_key.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/action.go b/models/action.go index 1715c05a..8b15f1cf 100644 --- a/models/action.go +++ b/models/action.go @@ -75,7 +75,7 @@ type Action struct { ID int64 UserID int64 // Receiver user ID OpType ActionType - ActUserID int64 // Doer user OD + ActUserID int64 // Doer user ID ActUserName string // Doer user name ActAvatar string `xorm:"-"` RepoID int64 `xorm:"INDEX"` diff --git a/models/ssh_key.go b/models/ssh_key.go index 798c58f2..00dc1af7 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -289,7 +289,7 @@ func CheckPublicKeyString(content string) (_ string, err error) { return "", errors.New("only a single line with a single key please") } - // remove any unnecessary whitespace now + // Remove any unnecessary whitespace content = strings.TrimSpace(content) if !setting.SSH.MinimumKeySizeCheck { -- cgit v1.2.3