Skip to content

Commit e12b8bf

Browse files
committed
fix: fix build on 32-bit platforms
This went unnoticed for so many years because obviously everyone was on 64-bit. Fixes: #219
1 parent 1913a2c commit e12b8bf

File tree

1 file changed

+2
-2
lines changed
  • internal/lowlevel/encryptor

1 file changed

+2
-2
lines changed

internal/lowlevel/encryptor/mod.go

Lines changed: 2 additions & 2 deletions
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)