Run of fresh-snapshots for golang-github-j-keck-arping

Merge these changes:

Summary

Merged new upstream version: 1.0.2+git20210705.1.c50f431 (was: 1.0.2).

Diff

Branch: main

diff --git a/arping_bsd.go b/arping_bsd.go
index 5176fc6..5b2ed10 100644
--- a/arping_bsd.go
+++ b/arping_bsd.go
@@ -96,6 +96,11 @@ func (s *BsdSocket) receive() (arpDatagram, time.Time, error) {
 	// skip bpf header + 14 bytes ethernet header
 	var hdrLength = bpfHdrLength + 14
 
+	if n <= hdrLength || len(buffer) <= hdrLength {
+		// amount of bytes read by socket is less than an ethernet header. clearly not what we look for
+		return arpDatagram{}, time.Now(), fmt.Errorf("buffer with invalid length")
+
+	}
 	return parseArpDatagram(buffer[hdrLength:n]), time.Now(), nil
 }
 
diff --git a/arping_linux.go b/arping_linux.go
index b03df6c..fc225da 100644
--- a/arping_linux.go
+++ b/arping_linux.go
@@ -1,6 +1,7 @@
 package arping
 
 import (
+	"fmt"
 	"net"
 	"syscall"
 	"time"
@@ -34,6 +35,11 @@ func (s *LinuxSocket) receive() (arpDatagram, time.Time, error) {
 	if err != nil {
 		return arpDatagram{}, time.Now(), err
 	}
+	if n <= 14 {
+		// amount of bytes read by socket is less than an ethernet header. clearly not what we look for
+		return arpDatagram{}, time.Now(), fmt.Errorf("buffer with invalid length")
+
+	}
 	// skip 14 bytes ethernet header
 	return parseArpDatagram(buffer[14:n]), time.Now(), nil
 }
diff --git a/arping_windows.go b/arping_windows.go
deleted file mode 100644
index abe302d..0000000
--- a/arping_windows.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// windows currently not supported.
-// dummy implementation to prevent compilation errors under windows
-
-package arping
-
-import (
-	"errors"
-	"net"
-	"time"
-)
-
-var errWindowsNotSupported = errors.New("arping under windows not supported")
-
-func initialize(iface net.Interface) error {
-	return errWindowsNotSupported
-}
-
-func send(request arpDatagram) (time.Time, error) {
-	return time.Now(), errWindowsNotSupported
-}
-
-func receive() (arpDatagram, time.Time, error) {
-	return arpDatagram{}, time.Now(), errWindowsNotSupported
-}
-
-func deinitialize() error {
-	return errWindowsNotSupported
-}
diff --git a/debian/changelog b/debian/changelog
index 3dceb0e..126b871 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-j-keck-arping (1.0.2+git20210705.1.c50f431-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Tue, 26 Apr 2022 16:09:09 -0000
+
 golang-github-j-keck-arping (1.0.2-1) unstable; urgency=medium
 
   [ Aloïs Micard ]

Branch: pristine-tar

diff --git a/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.delta b/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.delta
new file mode 100644
index 0000000..f55ebaa
Binary files /dev/null and b/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.delta differ
diff --git a/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.id b/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.id
new file mode 100644
index 0000000..29b21a2
--- /dev/null
+++ b/golang-github-j-keck-arping_1.0.2+git20210705.1.c50f431.orig.tar.gz.id
@@ -0,0 +1 @@
+09787ffd8ca35d9c365175afdd581edcab0ae310

Branch: upstream

Tag: upstream/1.0.2+git20210705.1.c50f431
diff --git a/arping_bsd.go b/arping_bsd.go
index 5176fc6..5b2ed10 100644
--- a/arping_bsd.go
+++ b/arping_bsd.go
@@ -96,6 +96,11 @@ func (s *BsdSocket) receive() (arpDatagram, time.Time, error) {
 	// skip bpf header + 14 bytes ethernet header
 	var hdrLength = bpfHdrLength + 14
 
+	if n <= hdrLength || len(buffer) <= hdrLength {
+		// amount of bytes read by socket is less than an ethernet header. clearly not what we look for
+		return arpDatagram{}, time.Now(), fmt.Errorf("buffer with invalid length")
+
+	}
 	return parseArpDatagram(buffer[hdrLength:n]), time.Now(), nil
 }
 
diff --git a/arping_linux.go b/arping_linux.go
index b03df6c..fc225da 100644
--- a/arping_linux.go
+++ b/arping_linux.go
@@ -1,6 +1,7 @@
 package arping
 
 import (
+	"fmt"
 	"net"
 	"syscall"
 	"time"
@@ -34,6 +35,11 @@ func (s *LinuxSocket) receive() (arpDatagram, time.Time, error) {
 	if err != nil {
 		return arpDatagram{}, time.Now(), err
 	}
+	if n <= 14 {
+		// amount of bytes read by socket is less than an ethernet header. clearly not what we look for
+		return arpDatagram{}, time.Now(), fmt.Errorf("buffer with invalid length")
+
+	}
 	// skip 14 bytes ethernet header
 	return parseArpDatagram(buffer[14:n]), time.Now(), nil
 }
diff --git a/arping_windows.go b/arping_windows.go
deleted file mode 100644
index abe302d..0000000
--- a/arping_windows.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// windows currently not supported.
-// dummy implementation to prevent compilation errors under windows
-
-package arping
-
-import (
-	"errors"
-	"net"
-	"time"
-)
-
-var errWindowsNotSupported = errors.New("arping under windows not supported")
-
-func initialize(iface net.Interface) error {
-	return errWindowsNotSupported
-}
-
-func send(request arpDatagram) (time.Time, error) {
-	return time.Now(), errWindowsNotSupported
-}
-
-func receive() (arpDatagram, time.Time, error) {
-	return arpDatagram{}, time.Now(), errWindowsNotSupported
-}
-
-func deinitialize() error {
-	return errWindowsNotSupported
-}

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☑ command has not changed
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far.not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 1253, max open: 300)
  • ☑ change set b4f141be-ca5d-4ac3-8a8c-4c436ee4c504 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots golang-github-j-keck-arping-dev

Lintian Result

Full worker log Full build log