[Nagiosplug-checkins] CVS: nagiosplug/plugins check_snmp.c,1.18,1.19

Subhendu Ghosh sghosh at users.sourceforge.net
Fri Nov 15 09:48:01 CET 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv27293

Modified Files:
	check_snmp.c 
Log Message:
memory bounds in options, no output comparison case

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** check_snmp.c	15 Nov 2002 00:50:19 -0000	1.18
--- check_snmp.c	15 Nov 2002 17:47:03 -0000	1.19
***************
*** 357,367 ****
  #endif
  		}
! 
! 		if (response && iresult == STATE_DEPENDENT)
! 			iresult = STATE_OK;
! 		else if (eval_method[i] & CRIT_PRESENT)
! 			iresult = STATE_CRITICAL;
! 		else if (eval_method[i] & WARN_PRESENT)
! 			iresult = STATE_WARNING;
  
  		result = max_state (result, iresult);
--- 357,368 ----
  #endif
  		}
! 		else {
! 			if (response && iresult == STATE_DEPENDENT) 
! 				iresult = STATE_OK;
! 			else if (eval_method[i] & CRIT_PRESENT)
! 				iresult = STATE_CRITICAL;
! 			else if (eval_method[i] & WARN_PRESENT)
! 				iresult = STATE_WARNING;
! 		}
  
  		result = max_state (result, iresult);
***************
*** 550,554 ****
  			strncpy (string_value, optarg, sizeof (string_value) - 1);
  			string_value[sizeof (string_value) - 1] = 0;
! 			eval_method[jj++] = CRIT_STRING;
  			break;
  		case 'R':									/* regex */
--- 551,555 ----
  			strncpy (string_value, optarg, sizeof (string_value) - 1);
  			string_value[sizeof (string_value) - 1] = 0;
! 			eval_method[jj] = CRIT_STRING;
  			break;
  		case 'R':									/* regex */
***************
*** 567,571 ****
  				return ERROR;
  			}
! 			eval_method[jj++] = CRIT_REGEX;
  #else
  			printf ("SNMP UNKNOWN: call for regex which was not a compiled option");
--- 568,572 ----
  				return ERROR;
  			}
! 			eval_method[jj] = CRIT_REGEX;
  #else
  			printf ("SNMP UNKNOWN: call for regex which was not a compiled option");





More information about the Commits mailing list