[Nagiosplug-devel] [ nagiosplug-Bugs-3588761 ] Buffer overrun with -u option by check_snmp.

SourceForge.net noreply at sourceforge.net
Tue Nov 20 17:14:42 CET 2012


Bugs item #3588761, was opened at 2012-11-20 07:58
Message generated for change (Comment added) made by j-bern
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3588761&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: release-1.4.15
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: one6f (one6f)
Assigned to: Nobody/Anonymous (nobody)
Summary: Buffer overrun with -u option by check_snmp.

Initial Comment:
Plugin Version (-V output): rested with check_snmp v1.4.16 (nagios-plugins 1.4.16) and v1.4.15

Plugin Name: check_snmp

Plugin Commandline showing issues:
./check_snmp -H 10.31.17.180 -C public -o "ifOperStatus.1,ifOperStatus.17,ifOperStatus.18,ifOperStatus.21,ifOperStatus.29" -u "port_1","port_17","port_18","port_21","port_29"
�� OK - up(1) port_1 up(1) port_17 up(1) port_18 up(1) port_21 up(1) port_29 |

If I leave out the last unit, "port_29", it shows SNMP OK 

Operating System:Ubuntu 10.04 LTS
Architecture: 64bit
Compiler: tested with apt-get install or self compiled with gcc



----------------------------------------------------------------------

Comment By: J. Bern (j-bern)
Date: 2012-11-20 08:14

Message:
Additional information:
-- Bug confirmed to exist in 1.4.14, 1.4.15 and 1.4.16 (from source on a
CentOS 5.5 machine)
-- apparently triggered by number of units provided (must be five or more)
-- probably *not* related: Note difference in second "if" expression:

# grep -n -A 2 'realloc (unitv' nagios-plugins-1.4.16/plugins/check_snmp.c
779:                            unitv = realloc (unitv, unitv_size);
780-                            if (unitv == NULL)
781-                                    die (STATE_UNKNOWN, _("Could not
reallocate units [%d]\n"), (int)nunits);
--
791:                                    unitv = realloc (unitv,
unitv_size);
792-                                    if (units == NULL)
793-                                            die (STATE_UNKNOWN,
_("Could not realloc() units\n"));

# UNITS="port_1,port_17,port_18,port_21,port_29,port_4711,port_grr"
# nagios-plugins-1.4.16/plugins/check_snmp $AUTH -o "$OIDS" -u "$UNITS" |
hexdump -C | head -2
00000000  db 5b b1 bf e3 5b b1 bf  ed 5b b1 bf 11 20 4f 4b  |.[...[...[...
OK|
00000010  20 2d 20 75 70 28 31 29  20 70 6f 72 74 5f 31 20  | - up(1)
port_1 |

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3588761&group_id=29880




More information about the Devel mailing list