Giter Site home page Giter Site logo

nas's People

Contributors

benhsu0723 avatar bjoern-r avatar calee0219 avatar chliu-nems avatar dependabot[bot] avatar edingroot avatar free5gc-org avatar haotingc avatar lyz508 avatar mariakagi avatar matsumu-y avatar ryuichinamba-fj avatar shouheinishi avatar tim-ywliu avatar youshengliu avatar zhonglin6666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nas's Issues

Crash by invalid NSSAI

Describe the bug

The function `snssaiToModels' is crashed by invalid S-NSSAI value.

To Reproduce

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'

Environment (please complete the following information):

  • module Version: v1.0.6
  • OS: Ubuntu 20.04.4 LTS
  • Kernel version: 5.4.0-104-generic
  • go version: go1.14.4 linux/amd64

Log File

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.