Skip to content

Commit 8d00647

Browse files
authored
Merge pull request #223 from xen0n/issue219
Fix build on 32-bit platforms
2 parents 1913a2c + a777fe4 commit 8d00647

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/go.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,22 @@ on:
1717
jobs:
1818

1919
build:
20-
runs-on: ubuntu-latest
2120
strategy:
2221
matrix:
23-
go: [ 'oldstable', 'stable' ]
22+
include:
23+
- go: 'oldstable'
24+
goarch: amd64
25+
runs-on: ubuntu-latest
26+
- go: 'stable'
27+
goarch: amd64
28+
runs-on: ubuntu-latest
29+
- go: 'stable'
30+
goarch: '386'
31+
runs-on: ubuntu-latest
32+
- go: 'stable'
33+
goarch: arm64
34+
runs-on: ubuntu-24.04-arm
35+
runs-on: ${{ matrix.runs-on }}
2436
steps:
2537
- uses: actions/checkout@v4
2638

@@ -29,6 +41,9 @@ jobs:
2941
with:
3042
go-version: ${{ matrix.go }}
3143

44+
- name: Set up GOARCH
45+
run: export GOARCH="${{ matrix.goarch }}"
46+
3247
- name: Build
3348
run: go build -v ./...
3449

internal/lowlevel/encryptor/mod.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func (e *WorkwxEncryptor) prepareBufForEncryption(payload *WorkwxPayload) ([]byt
114114
}
115115

116116
buf = buf[:cap(buf)] // grow to full capacity
117-
msglen := len(payload.Msg)
118-
if msglen < 0 || msglen > math.MaxUint32 {
117+
msglen := uint64(len(payload.Msg))
118+
if msglen > uint64(math.MaxUint32) {
119119
return nil, errPayloadTooBig
120120
}
121121
binary.BigEndian.PutUint32(buf[16:], uint32(msglen))

0 commit comments

Comments
 (0)