This fixes a crash of check_dhcp caused by stack smashing, which
in turn is caused by int vs. size_t mismatch when calling sysctl(3).

The same bug applies to 6.1 packages, so I'm asking for okays
for both -CURRENT and -STABLE.

--
WBR,
  Vadim Zhukov


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/monitoring-plugins/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    16 Jul 2017 19:18:58 -0000      1.13
+++ Makefile    19 Jul 2017 11:01:50 -0000
@@ -12,7 +12,7 @@ COMMENT-snmp= monitoring plugins using s
 COMMENT-radius=        RADIUS monitoring plugin
 
 V=             2.2
-REVISION-main= 1
+REVISION-main= 2
 DISTNAME=      monitoring-plugins-$V
 PKGNAME-main=  monitoring-plugins-$V
 PKGNAME-dbi=   monitoring-plugins-dbi-$V
Index: patches/patch-plugins-root_check_dhcp_c
===================================================================
RCS file: patches/patch-plugins-root_check_dhcp_c
diff -N patches/patch-plugins-root_check_dhcp_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-plugins-root_check_dhcp_c     19 Jul 2017 11:01:50 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+Fix stack smashing.
+
+Upstream merge request:
+https://github.com/monitoring-plugins/monitoring-plugins/pull/1500
+--- plugins-root/check_dhcp.c.orig     Wed Jul 19 12:53:55 2017
++++ plugins-root/check_dhcp.c  Wed Jul 19 13:46:40 2017
+@@ -323,7 +323,8 @@ int get_hardware_address(int sock,char *interface_name
+ #elif defined(__bsd__)
+                                               /* King 2004    see 
ACKNOWLEDGEMENTS */
+ 
+-        int                     mib[6], len;
++        int                     mib[6];
++        size_t                  len;
+         char                    *buf;
+         unsigned char           *ptr;
+         struct if_msghdr        *ifm;

Reply via email to