check_http segfaults with "-a x" option
HTTP OK HTTP/1.0 200 OK - 6094 bytes in 0.134 seconds |time=0.
Segmentation fault (core dumped)
HTTP OK HTTP/1.0 200 OK - 6084 bytes in 0.151 seconds |time=0.
$ 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];
#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.