Merge pull request #68 from boyand/master

Avoid unsafe dereferencing
This commit is contained in:
Asim Aslam 2016-04-01 09:42:17 +01:00
commit ce283ab233

View File

@ -111,8 +111,8 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
if err != nil { if err != nil {
return err return err
} }
m.Method = *rtmp.ServiceMethod m.Method = rtmp.GetServiceMethod()
m.Id = *rtmp.Seq m.Id = rtmp.GetSeq()
case codec.Response: case codec.Response:
data, err := ReadNetString(c.rwc) data, err := ReadNetString(c.rwc)
if err != nil { if err != nil {
@ -123,9 +123,9 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
if err != nil { if err != nil {
return err return err
} }
m.Method = *rtmp.ServiceMethod m.Method = rtmp.GetServiceMethod()
m.Id = *rtmp.Seq m.Id = rtmp.GetSeq()
m.Error = *rtmp.Error m.Error = rtmp.GetError()
case codec.Publication: case codec.Publication:
io.Copy(c.buf, c.rwc) io.Copy(c.buf, c.rwc)
default: default: