Browse Source

rtmp: return error in case of extended chunk stream IDs (#2806)

pull/2808/head
Alessandro Ros 1 year ago committed by GitHub
parent
commit
22414bb38c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      internal/protocols/rtmp/rawmessage/reader.go
  2. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef
  3. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b
  4. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f
  5. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5
  6. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24
  7. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841
  8. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098
  9. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d
  10. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba
  11. 2
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289
  12. 0
      internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/19981bffc2abbaf1

4
internal/protocols/rtmp/rawmessage/reader.go

@ -293,6 +293,10 @@ func (r *Reader) Read() (*Message, error) { @@ -293,6 +293,10 @@ func (r *Reader) Read() (*Message, error) {
typ := byt >> 6
chunkStreamID := byt & 0x3F
if chunkStreamID < 2 {
return nil, fmt.Errorf("extended chunk stream IDs are not supported (yet)")
}
rc, ok := r.chunkStreams[chunkStreamID]
if !ok {
rc = &readerChunkStream{mr: r}

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("\xe6")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("0000\xf4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("0000\x00\x00000000000000000000000000000000000000000000000000000000\xb0")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("0")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("\x00000\x00\x00\x04000000000\x800000000\xc0")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\xf0")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000p")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\xb0")

2
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 vendored

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
go test fuzz v1
[]byte("\x80")

0
internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 → internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/19981bffc2abbaf1 vendored

Loading…
Cancel
Save