Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion platform-manageability-agent/internal/comms/comms.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package comms

import (
"bufio"
"bytes"
"context"
"crypto/tls"
"errors"
Expand Down Expand Up @@ -142,7 +143,7 @@ func (cli *Client) IsActivationInProgress() bool {
return cli.isActivationInProgress.Load()
}
func parseAMTInfoField(output []byte, parseKey string) (string, bool) {
scanner := bufio.NewScanner(strings.NewReader(string(output)))
scanner := bufio.NewScanner(bytes.NewReader(output))
for scanner.Scan() {
line := scanner.Text()

Expand Down
3 changes: 2 additions & 1 deletion platform-update-agent/internal/utils/os_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package utils

import (
"bufio"
"bytes"
"fmt"
"strings"
)
Expand All @@ -28,7 +29,7 @@ func DetectOS(reader FileReader, forcedOS string) (string, error) {
return "", fmt.Errorf("failed to open /etc/os-release: %v", err)
}

scanner := bufio.NewScanner(strings.NewReader(string(content)))
scanner := bufio.NewScanner(bytes.NewReader(content))
var osId string
for scanner.Scan() {
line := scanner.Text()
Expand Down