check_http segfaults with "-a x" option

Bug #201054 reported by Adam Buchbinder on 2008-03-11
Affects Status Importance Assigned to Milestone
Nagios Plugins
nagios-plugins (Ubuntu)

Bug Description

To reproduce:

$ /usr/lib/nagios/plugins/check_http
HTTP OK HTTP/1.0 200 OK - 6094 bytes in 0.134 seconds |time=0.133703s;;;0.000000 size=6094B;;;0
$ /usr/lib/nagios/plugins/check_http -a x
Segmentation fault (core dumped)
$ /usr/lib/nagios/plugins/check_http -a xx
HTTP OK HTTP/1.0 200 OK - 6084 bytes in 0.151 seconds |time=0.150939s;;;0.000000 size=6084B;;;0

Backtrace follows.

$ gdb check_http
(gdb) run -a x
Program received signal SIGSEGV, Segmentation fault.
0x0804b219 in check_http () at check_http.c:469
469 buf[i++] = base64_table[bin[j] >> 2];
(gdb) bt
#0 0x0804b219 in check_http () at check_http.c:469
#1 0x0804e3f0 in main (argc=Cannot access memory at address 0x17f1c
) at check_http.c:160

It appears that a one-character argument to "-a" causes a segfault, while more than one character averts this. A one-character argument to "-a" isn't a conceivably valid option, but the program still shouldn't crash.

This is replicable with nagios-plugins 1.4.8-2.1ubuntu1.1 on Gutsy, and is still present in 1.4.11 downloaded from

Julius Bloch (jbloch) wrote :

I can confirm that on Gutsy.

dpkg -l nagios-plugins-basic
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Beschreibung
ii nagios-plugins-basic 1.4.8-2.1ubuntu1 Plugins for the nagios network monitoring and management system

Changed in nagios-plugins:
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nagios-plugins - 1.4.11-1ubuntu3

nagios-plugins (1.4.11-1ubuntu3) hardy; urgency=low

  * debian/patches/99_check_http_segfault.dpatch.
    - Fix segfaulting when check_http -a x. (LP: #201054)

 -- Chuck Short <email address hidden> Mon, 14 Apr 2008 12:47:52 -0400

Changed in nagios-plugins:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.