summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_vivc.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/option_vivc.go')
-rw-r--r--dhcpv4/option_vivc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/dhcpv4/option_vivc.go b/dhcpv4/option_vivc.go
index 9be8557..7576637 100644
--- a/dhcpv4/option_vivc.go
+++ b/dhcpv4/option_vivc.go
@@ -30,12 +30,12 @@ func ParseOptVIVC(data []byte) (*OptVIVC, error) {
if code != OptionVendorIdentifyingVendorClass {
return nil, fmt.Errorf("expected code %v, got %v", OptionVendorIdentifyingVendorClass, code)
}
- length := int(data[1])
- data = data[2:]
- if length != len(data) {
+ length := int(data[1])
+ if len(data) < 2+length {
return nil, ErrShortByteStream
}
+ data = data[2:length+2]
ids := []VIVCIdentifier{}
for len(data) > 5 {