Skip to content

Commit 2b85904

Browse files
authored
fix(weiyun): bump weiyun-sdk-go to v0.1.4 to fix nil pointer panic on Init (#9561)
The upstream SDK v0.1.3 had a bug in Resp.HasError() that dereferenced r.Data without a nil check (types.go:38), causing a nil pointer panic when mounting Weiyun storage if the API returned a response with an empty data field. v0.1.4 guards the nil access. LoginType() also changed from int8 to a string enum in v0.1.4, so the QQ-cookie keepalive check is updated to compare against AccountTypeQQ. Fixes #9551
1 parent 488426d commit 2b85904

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/weiyun/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (d *WeiYun) Init(ctx context.Context) error {
6767
})
6868

6969
// qqCookie保活
70-
if d.client.LoginType() == 1 {
70+
if d.client.LoginType() == weiyunsdkgo.AccountTypeQQ {
7171
d.cron = cron.NewCron(time.Minute * 5)
7272
d.cron.Do(func() {
7373
_ = d.client.KeepAlive()

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564
3232
github.com/fatedier/frp v0.68.0
3333
github.com/foxxorcat/mopan-sdk-go v0.1.6
34-
github.com/foxxorcat/weiyun-sdk-go v0.1.3
34+
github.com/foxxorcat/weiyun-sdk-go v0.1.4
3535
github.com/gin-contrib/cors v1.7.2
3636
github.com/gin-gonic/gin v1.10.0
3737
github.com/go-resty/resty/v2 v2.14.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ github.com/foxxorcat/mopan-sdk-go v0.1.6 h1:6J37oI4wMZLj8EPgSCcSTTIbnI5D6RCNW/sr
254254
github.com/foxxorcat/mopan-sdk-go v0.1.6/go.mod h1:UaY6D88yBXWGrcu/PcyLWyL4lzrk5pSxSABPHftOvxs=
255255
github.com/foxxorcat/weiyun-sdk-go v0.1.3 h1:I5c5nfGErhq9DBumyjCVCggRA74jhgriMqRRFu5jeeY=
256256
github.com/foxxorcat/weiyun-sdk-go v0.1.3/go.mod h1:TPxzN0d2PahweUEHlOBWlwZSA+rELSUlGYMWgXRn9ps=
257+
github.com/foxxorcat/weiyun-sdk-go v0.1.4 h1:X2tFvdqikkJ7awCBbMH7XXk7+uQoJlQksJz9CUU6ZgA=
258+
github.com/foxxorcat/weiyun-sdk-go v0.1.4/go.mod h1:TPxzN0d2PahweUEHlOBWlwZSA+rELSUlGYMWgXRn9ps=
257259
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
258260
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
259261
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=

0 commit comments

Comments
 (0)