Compare commits

..

No commits in common. "28dc629674d86a0618064503dbbdd02c0baffac8" and "d4dc212dd3e30e275aed443b5c1574e8cf476aa3" have entirely different histories.

5 changed files with 423 additions and 960 deletions

View file

@ -54,7 +54,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@ -65,7 +65,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 uses: github/codeql-action/autobuild@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@ -79,4 +79,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13

View file

@ -75,6 +75,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with: with:
sarif_file: results.sarif sarif_file: results.sarif

View file

@ -21,7 +21,7 @@ var (
func TestBase64LineBreaker(t *testing.T) { func TestBase64LineBreaker(t *testing.T) {
t.Run("write, copy and close", func(t *testing.T) { t.Run("write, copy and close", func(t *testing.T) {
logoWriter := bytes.NewBuffer(nil) logoWriter := &bytes.Buffer{}
lineBreaker := &Base64LineBreaker{out: logoWriter} lineBreaker := &Base64LineBreaker{out: logoWriter}
t.Cleanup(func() { t.Cleanup(func() {
if err := lineBreaker.Close(); err != nil { if err := lineBreaker.Close(); err != nil {
@ -43,7 +43,7 @@ func TestBase64LineBreaker(t *testing.T) {
} }
}) })
logoWriter := bytes.NewBuffer(nil) logoWriter := &bytes.Buffer{}
lineBreaker := &Base64LineBreaker{out: logoWriter} lineBreaker := &Base64LineBreaker{out: logoWriter}
t.Cleanup(func() { t.Cleanup(func() {
if err := lineBreaker.Close(); err != nil { if err := lineBreaker.Close(); err != nil {
@ -237,9 +237,9 @@ func FuzzBase64LineBreaker(f *testing.F) {
} }
f.Fuzz(func(t *testing.T, data []byte) { f.Fuzz(func(t *testing.T, data []byte) {
buffer := bytes.NewBuffer(nil) var buffer bytes.Buffer
lineBreaker := &Base64LineBreaker{ lineBreaker := &Base64LineBreaker{
out: buffer, out: &buffer,
} }
base64Encoder := base64.NewEncoder(base64.StdEncoding, lineBreaker) base64Encoder := base64.NewEncoder(base64.StdEncoding, lineBreaker)

File diff suppressed because it is too large Load diff

View file

@ -554,19 +554,8 @@ func (c *Client) Noop() error {
// Quit sends the QUIT command and closes the connection to the server. // Quit sends the QUIT command and closes the connection to the server.
func (c *Client) Quit() error { func (c *Client) Quit() error {
// If we already tried to send a EHLO/HELO but it failed, we still need to be able to send if err := c.hello(); err != nil {
// a QUIT to close the connection. return err
// c.hello() will return the global helloErr of the Client, which will always be set if the HELO
// failed before. Therefore if we already sent a HELO and the error is not nil, we skip another
// EHLO/HELO try
c.mutex.RLock()
didHello := c.didHello
helloErr := c.helloError
c.mutex.RUnlock()
if !didHello || helloErr == nil {
if err := c.hello(); err != nil {
return err
}
} }
_, _, err := c.cmd(221, "QUIT") _, _, err := c.cmd(221, "QUIT")
if err != nil { if err != nil {