fuzz: enable for setters and fix found crashers

This commit is contained in:
Aleksandr Razumov
2017-02-26 18:40:07 +03:00
parent 0916b34039
commit 1eef04448c
42 changed files with 245 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package stun
import (
"errors"
"fmt"
"io"
)
// ErrorCodeAttribute represents ERROR-CODE attribute.
@@ -51,6 +52,9 @@ func (c *ErrorCodeAttribute) GetFrom(m *Message) error {
if err != nil {
return err
}
if len(v) < errorCodeReasonStart {
return io.ErrUnexpectedEOF
}
var (
class = uint16(v[errorCodeClassByte])
number = uint16(v[errorCodeNumberByte])