Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
RMR params payload points to params msgbuf. Make sure that freed memory is not used
[ric-plt/submgr.git]
/
pkg
/
teststub
/
controlRmrStub.go
diff --git
a/pkg/teststub/controlRmrStub.go
b/pkg/teststub/controlRmrStub.go
index
0f207e8
..
958b8b8
100644
(file)
--- a/
pkg/teststub/controlRmrStub.go
+++ b/
pkg/teststub/controlRmrStub.go
@@
-88,6
+88,10
@@
func (tc *RmrStubControl) Consume(params *xapp.RMRParams) (err error) {
msg := xapptweaks.NewParams(params)
tc.CntRecvMsg++
msg := xapptweaks.NewParams(params)
tc.CntRecvMsg++
+ cPay := append(msg.Payload[:0:0], msg.Payload...)
+ msg.Payload = cPay
+ msg.PayloadLen = len(cPay)
+
if msg.Mtype == tc.InitMsg {
tc.Logger.Info("Testing message ignore %s", msg.String())
tc.SetActive()
if msg.Mtype == tc.InitMsg {
tc.Logger.Info("Testing message ignore %s", msg.String())
tc.SetActive()