Bug 198318 - net-mgmt/nagios-plugins: check_dhcp segfaults in command line parser
Summary: net-mgmt/nagios-plugins: check_dhcp segfaults in command line parser
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mathieu Arnold
Depends on:
Reported: 2015-03-05 16:38 UTC by Ian Pallfreeman
Modified: 2015-03-10 11:40 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (mat)


Note You need to log in before you can comment on or make changes to this bug.
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 2015-03-10 11:39:38 UTC
committed to both nagios-plugins and monitoring-plugins
Comment 2 commit-hook freebsd_committer 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

  Fix a segfault in check_dhcp.

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