You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had one crash report this afternoon. The stack is pasted above.
Current project is using webrtc/v2, which uses sctp v1.7.9. But I checked new changes and don't see any addressed the issue above.
The panic line is if !bytes.Equal(a.myCookie.cookie, c.cookie) { in below func:
// The caller should hold the lock.func (a*Association) handleCookieEcho(c*chunkCookieEcho) []*packet {
state:=a.getState()
a.log.Debugf("[%s] COOKIE-ECHO received in state '%s'", a.name, getAssociationStateString(state))
switchstate {
default:
returnnilcaseestablished:
if!bytes.Equal(a.myCookie.cookie, c.cookie) {
returnnil
}
caseclosed, cookieWait, cookieEchoed:
if!bytes.Equal(a.myCookie.cookie, c.cookie) {
returnnil
}
since a *Association is not nil, so I guess either a.myCookie or c is nil.
as c is a chunk (interface) to a concrete type (pointer). seems no chance to panic on dereferencing c.cookie. So probably a.myCookie is nil in this case?
but in any case it failed to init myCookie, the error would be ignored in caller function handleChunk. However I'm not sure why rand.Reader would fail in this case:
funcnewRandomStateCookie() (*paramStateCookie, error) {
randCookie:=make([]byte, 32)
_, err:=rand.Read(randCookie)
// crypto/rand.Read returns n == len(b) if and only if err == nil.iferr!=nil {
returnnil, err
}
s:=¶mStateCookie{
cookie: randCookie,
}
returns, nil
}
or handleCookieEcho happened before handleInit?
What did you expect?
No panic.
The text was updated successfully, but these errors were encountered:
Your environment.
What did you do?
We had one crash report this afternoon. The stack is pasted above.
Current project is using webrtc/v2, which uses sctp v1.7.9. But I checked new changes and don't see any addressed the issue above.
The panic line is
if !bytes.Equal(a.myCookie.cookie, c.cookie) {
in belowfunc
:since
a *Association
is notnil
, so I guess eithera.myCookie
orc
isnil
.c
comes from:and the unmarshalling looks good:
as
c
is achunk
(interface) to a concrete type (pointer). seems no chance to panic on dereferencingc.cookie
. So probablya.myCookie
isnil
in this case?myCookie
is initialised inhandleInit
:but in any case it failed to init
myCookie
, the error would be ignored in caller functionhandleChunk
. However I'm not sure whyrand.Reader
would fail in this case:or
handleCookieEcho
happened beforehandleInit
?What did you expect?
No panic.
The text was updated successfully, but these errors were encountered: