check_http segfaults with "-a x" option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Nagios Plugins |
Unknown
|
Unknown
|
|||
nagios-plugins (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
To reproduce:
$ /usr/lib/
HTTP OK HTTP/1.0 200 OK - 6094 bytes in 0.134 seconds |time=0.
$ /usr/lib/
Segmentation fault (core dumped)
$ /usr/lib/
HTTP OK HTTP/1.0 200 OK - 6084 bytes in 0.151 seconds |time=0.
Backtrace follows.
$ gdb check_http
[...]
(gdb) run google.com -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 nagiosplugins.org.
Hi,
I can confirm that on Gutsy.
dpkg -l nagios- plugins- basic Unknown/ Install/ Remove/ Purge/Hold Not/Installed/ Config- f/Unpacked/ Failed- cfg/Half- inst/t- aWait/T- pend /Hold/Reinst- required/ X=both- problems (Status,Err: uppercase=bad) ======= ======= ======= ======= ======= -====== ======= ======= ======= ======= ====-== ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ====== plugins- basic 1.4.8-2.1ubuntu1 Plugins for the nagios network monitoring and management system
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Beschreibung
+++-===
ii nagios-