fix: database/sql.Scanner should not retain references (#6380)

This commit is contained in:
Nuno Cruces 2023-06-07 08:02:07 +01:00 committed by GitHub
parent 661781a3d7
commit 7157b7e375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -170,10 +170,10 @@ func (data *EncryptedData) Scan(value interface{}) error {
return errors.New("Too short")
}
*data = b[3:]
*data = append((*data)[0:], b[3:]...)
return nil
} else if s, ok := value.(string); ok {
*data = []byte(s)[3:]
*data = []byte(s[3:])
return nil
}