From 5718ce56973b3afbfe44b7e3aa6f65495224524a Mon Sep 17 00:00:00 2001 From: Boyan Dimitrov Date: Fri, 1 Apr 2016 10:28:52 +0200 Subject: [PATCH] Avoid unsafe dereferencing --- codec/protorpc/protorpc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/codec/protorpc/protorpc.go b/codec/protorpc/protorpc.go index 51f9e06c..22eecd7f 100644 --- a/codec/protorpc/protorpc.go +++ b/codec/protorpc/protorpc.go @@ -111,8 +111,8 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error { if err != nil { return err } - m.Method = *rtmp.ServiceMethod - m.Id = *rtmp.Seq + m.Method = rtmp.GetServiceMethod() + m.Id = rtmp.GetSeq() case codec.Response: data, err := ReadNetString(c.rwc) if err != nil { @@ -123,9 +123,9 @@ func (c *protoCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error { if err != nil { return err } - m.Method = *rtmp.ServiceMethod - m.Id = *rtmp.Seq - m.Error = *rtmp.Error + m.Method = rtmp.GetServiceMethod() + m.Id = rtmp.GetSeq() + m.Error = rtmp.GetError() case codec.Publication: io.Copy(c.buf, c.rwc) default: