free5gc / nas Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
The function `snssaiToModels' is crashed by invalid S-NSSAI value.
Apply this patch
diff --git a/nasConvert/Nssai_test.go b/nasConvert/Nssai_test.go
index 9a7bdee..a5e8633 100644
--- a/nasConvert/Nssai_test.go
+++ b/nasConvert/Nssai_test.go
@@ -77,7 +77,7 @@ func TestRequestedNssaiToModels(t *testing.T) {
Iei: nasMessage.RegistrationRequestRequestedNSSAIType,
Len: 2,
Buffer: []uint8{
- 0x09, 0x01,
+ 0x02, 0x01,
},
},
nil,
Run test `TestRequestedNssaiToModels'
Running tool: /usr/local/go/bin/go test -timeout 30s -run ^TestRequestedNssaiToModels$ github.com/free5gc/nas/nasConvert
..E
Errors:
* /home/nishi/free5gc-deb/libs/nas/nasConvert/Nssai_test.go
Line 88: - runtime error: index out of range [2] with length 2
goroutine 19 [running]:
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/reporting/reports.go:148 +0x6d
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/reporting/reports.go:121 +0x70
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:235 +0x137
panic(0x62ca60, 0xc0001501c0)
/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/free5gc/nas/nasConvert.snssaiToModels(0xc00011e702, 0xc00011e798, 0x2, 0x2, 0xc000116de0, 0x7fcb40, 0x7febeb0c2e98, 0xc000116e10)
/home/nishi/free5gc-deb/libs/nas/nasConvert/Nssai.go:48 +0x7ea
github.com/free5gc/nas/nasConvert.RequestedNssaiToModels(0xc000100240, 0x2, 0x2, 0x8, 0x0, 0x0)
/home/nishi/free5gc-deb/libs/nas/nasConvert/Nssai.go:21 +0x126
github.com/free5gc/nas/nasConvert_test.TestRequestedNssaiToModels.func1()
/home/nishi/free5gc-deb/libs/nas/nasConvert/Nssai_test.go:88 +0x124
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/discovery.go:80 +0x24
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:261 +0x121
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:110 +0xee
github.com/jtolds/gls.(*ContextManager).SetValues.func1(0x0)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:97 +0x44c
github.com/jtolds/gls.EnsureGoroutineId.func1()
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0x2e
github.com/jtolds/gls._m(0x0, 0xc00012c5a0)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:108 +0x31
github.com/jtolds/gls.github_com_jtolds_gls_markS(0x0, 0xc00012c5a0)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:56 +0x35
github.com/jtolds/gls.addStackTag(...)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/stack_tags.go:49
github.com/jtolds/gls.EnsureGoroutineId(0xc000116d20)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/gid.go:24 +0xf2
github.com/jtolds/gls.(*ContextManager).SetValues(0xc000112890, 0xc000116cc0, 0xc00012c560)
/home/nishi/go/pkg/mod/github.com/jtolds/[email protected]+incompatible/context.go:63 +0x14b
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/context.go:105 +0x227
/home/nishi/go/pkg/mod/github.com/smartystreets/[email protected]/convey/doc.go:75 +0xbe
github.com/free5gc/nas/nasConvert_test.TestRequestedNssaiToModels(0xc0001467e0)
/home/nishi/free5gc-deb/libs/nas/nasConvert/Nssai_test.go:86 +0x409
testing.tRunner(0xc0001467e0, 0x6510b8)
/usr/local/go/src/testing/testing.go:991 +0xdc
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1042 +0x357
goroutine 1 [chan receive]:
testing.(*T).Run(0xc0001467e0, 0x648e01, 0x1a, 0x6510b8, 0x486c76)
/usr/local/go/src/testing/testing.go:1043 +0x37e
testing.runTests.func1(0xc0001466c0)
/usr/local/go/src/testing/testing.go:1284 +0x78
testing.tRunner(0xc0001466c0, 0xc000163e10)
/usr/local/go/src/testing/testing.go:991 +0xdc
testing.runTests(0xc00012c3a0, 0x7f3480, 0x1, 0x1, 0x0)
/usr/local/go/src/testing/testing.go:1282 +0x2a7
testing.(*M).Run(0xc000158000, 0x0)
/usr/local/go/src/testing/testing.go:1199 +0x15f
main.main()
_testmain.go:46 +0x135
3 total assertions
--- FAIL: TestRequestedNssaiToModels (0.00s)
FAIL
FAIL github.com/free5gc/nas/nasConvert 0.007s
FAIL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.