Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591194 - net-analyzer/nagios-plugins-snmp: check_snmp_storage - segmentation fault when -w and -c is reversed and type not specified
Summary: net-analyzer/nagios-plugins-snmp: check_snmp_storage - segmentation fault whe...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sysadmin Bugs
URL: https://sourceforge.net/p/nagios-snmp...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-08-13 15:55 UTC by Fredric Johansson
Modified: 2019-11-29 09:38 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix default type name if not given (check_snmp_storage-deftype-fix.patch,548 bytes, patch)
2016-08-13 15:55 UTC, Fredric Johansson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fredric Johansson 2016-08-13 15:55:28 UTC
Created attachment 443240 [details, diff]
Fix default type name if not given

check_snmp_storage segfaults when -T/--type is not given and -w and -c have reversed values for the default type. Segfaults occurs when it tries to print the error message:

$ gdb --args  /usr/lib64/nagios/plugins/check_snmp_storage -C my-own-community -H 127.0.0.1 -m /usr/portage/distfiles -w 30 -c 10
<snip>
Reading symbols from /usr/lib64/nagios/plugins/check_snmp_storage...done.
(gdb) r
Starting program: /usr/lib64/nagios/plugins/check_snmp_storage -C my-own-community -H 127.0.0.1 -m /usr/portage/distfiles -w 30 -c 10

Program received signal SIGSEGV, Segmentation fault.
0x000003fff7789da5 in vfprintf () from /lib64/libc.so.6
(gdb) bt
#0  0x000003fff7789da5 in vfprintf () from /lib64/libc.so.6
#1  0x000003fff783f7e2 in __printf_chk () from /lib64/libc.so.6
#2  0x000002aaaaaac3c6 in printf (__fmt=<optimized out>) at /usr/include/bits/stdio2.h:104
#3  main (argc=<optimized out>, argv=<optimized out>) at check_snmp_storage.c:252
(gdb)

Attached patch assigns the plaintext type name to the variable if not given.