Bug 198318

Summary: net-mgmt/nagios-plugins: check_dhcp segfaults in command line parser
Product: Ports & Packages Reporter: Ian Pallfreeman <ip>
Component: Individual Port(s)Assignee: Mathieu Arnold <mat>
Status: Closed FIXED    
Severity: Affects Only Me CC: ip
Priority: --- Flags: bugzilla: maintainer-feedback? (mat)
Version: Latest   
Hardware: Any   
OS: Any   

Description Ian Pallfreeman 2015-03-05 16:38:12 UTC
The nagios plugin check_dhcp dies with a segfault on some (not all!) systems. 

Mar  5 15:20:45 lilith kernel: pid 8543 (check_dhcp), uid 0: exited on signal 11

This seems to be an off-by-one in the command line parser. Note that this cannot be reproduced by running check_dhcp directly from the command line, it only happens when run by a nagios worker. 

--- check_dhcp.c.orig   2015-03-05 15:25:55.000000000 +0000
+++ check_dhcp.c        2015-03-05 15:26:33.000000000 +0000
@@ -1185,7 +1185,7 @@
                        }
                }
 
-       return i;
+       return i+1;
         }
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2015-03-10 11:39:38 UTC
committed to both nagios-plugins and monitoring-plugins
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-03-10 11:40:17 UTC
A commit references this bug:

Author: mat
Date: Tue Mar 10 11:39:19 UTC 2015
New revision: 380908
URL: https://svnweb.freebsd.org/changeset/ports/380908

Log:
  Fix a segfault in check_dhcp.

  PR:		198318
  Submitted by:	Ian Pallfreeman
  Sponsored by:	Absolight

Changes:
  head/net-mgmt/monitoring-plugins/Makefile
  head/net-mgmt/monitoring-plugins/files/patch-plugins-root_check__dhcp.c
  head/net-mgmt/nagios-plugins/Makefile
  head/net-mgmt/nagios-plugins/files/patch-plugins-root_check__dhcp.c