[Secureideas-cvs] base-php4/includes base_state_criteria.inc.php, 1.22, 1.23
Brought to you by:
secureideas,
sinukas
From: Juergen L. <jle...@us...> - 2009-05-02 20:12:03
|
Update of /cvsroot/secureideas/base-php4/includes In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv399/base-php4/includes Modified Files: base_state_criteria.inc.php Log Message: On occasion of Bug Number 2620784, in: https://sourceforge.net/tracker/?func=detail&atid=635582&aid=2620784&group_id=103348 Extended an error message by a backtrace command. Hopefully helpful for remote debugging, as I am not able to generate the bug condition. The error message in question is now triggered, even when debug_mode has NOT been enabled. Also done some cosmetics, this time to make any syntax errors more easily recognizable. Bug No. 2620784 gives some rise to the suspicion that a crash is happening. See also base-php4/includes/base_action.inc.php. Index: base_state_criteria.inc.php =================================================================== RCS file: /cvsroot/secureideas/base-php4/includes/base_state_criteria.inc.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- base_state_criteria.inc.php 21 Dec 2008 09:11:00 -0000 1.22 +++ base_state_criteria.inc.php 2 May 2009 20:11:47 -0000 1.23 @@ -43,8 +43,8 @@ /* XXX-SEC */ GLOBAL $db, $debug_mode; - $tdb =& $db; - $obj =& $this; + $tdb =& $db; + $obj =& $this; $this->criteria['sig'] = new SignatureCriteria($tdb, $obj, "sig"); $this->criteria['sig_class'] = new SignatureClassificationCriteria($tdb, $obj, "sig_class"); $this->criteria['sig_priority'] = new SignaturePriorityCriteria($tdb, $obj, "sig_priority"); @@ -70,7 +70,7 @@ /******* <xxx jl debugging> *********/ - if ($debug_mode > 0) + if ($debug_mode >= 0) // temporarily enabled for everybody { if (isset($_GET) && is_array($_GET) && count($_GET) > 6) { @@ -83,39 +83,68 @@ if (isset($debug_array)) { - foreach($debug_array as $debug_key) + if (empty($debug_array)) { - if ( - ($debug_key != "new") && ($debug_key != "sort_order") && - ($debug_key != "submit") && ($debug_key != "caller") && - ($debug_key != "num_result_rows") && ($debug_key != "current_view") && - ($debug_key != "search") && ($debug_key != "sig") && - ($debug_key != "sig_class") && ($debug_key != "sig_priority") && - ($debug_key != "ag") && ($debug_key != "sensor") && - ($debug_key != "time") && ($debug_key != "ip_addr") && - ($debug_key != "layer4") && ($debug_key != "ip_field") && - ($debug_key != "tcp_port") && ($debug_key != "udp_field") && - ($debug_key != "rawip_field") && ($debug_key != "data") && - ($debug_key != "data_encode") && ($debug_key != "prev_sort_order") && - ($debug_key != "action_lst") && ($debug_key != "action") && - ($debug_key != "action_arg") && ($debug_key != "ag_id") && - ($debug_key != "ag_name") && ($debug_key != "ag_desc") && - ($debug_key != "ag_action") && ($debug_key != "action_chk_lst") && - ($debug_key != "addr_type") /* && ($debug_key != "") && - ($debug_key != "") && ($debug_key != "") && - ($debug_key != "") && ($debug_key != "") && - ($debug_key != "") && ($debug_key != "") && - */ - ) + ErrorMessage(__FILE__ . ":" . __LINE__ . ": " . "WARNING: \$debug_array is empty.<BR>\n"); + } + else + { + foreach($debug_array as $debug_key) { - ErrorMessage(__FILE__ . ":" . __LINE__ . ": " . "WARNING: The following query key has not been implemented, yet: \"" . $debug_key . "\".<BR>\n" . "Report it to the BASE developers, please.<BR>\n"); - } - } - } - } + if (empty($debug_key)) + { + ErrorMessage(__FILE__ . ":" . __LINE__ . ": " . "WARNING: \$debug_key is empty.<BR>\n"); + continue; + } + + if ( + ($debug_key != "new") && + ($debug_key != "sort_order") && + ($debug_key != "submit") && + ($debug_key != "caller") && + ($debug_key != "num_result_rows") && + ($debug_key != "current_view") && + ($debug_key != "search") && + ($debug_key != "sig") && + ($debug_key != "sig_class") && + ($debug_key != "sig_priority") && + ($debug_key != "ag") && + ($debug_key != "sensor") && + ($debug_key != "time") && + ($debug_key != "ip_addr") && + ($debug_key != "layer4") && + ($debug_key != "ip_field") && + ($debug_key != "tcp_port") && + ($debug_key != "udp_field") && + ($debug_key != "rawip_field") && + ($debug_key != "data") && + ($debug_key != "data_encode") && + ($debug_key != "prev_sort_order") && + ($debug_key != "action_lst") && + ($debug_key != "action") && + ($debug_key != "action_arg") && + ($debug_key != "ag_id") && + ($debug_key != "ag_name") && + ($debug_key != "ag_desc") && + ($debug_key != "ag_action") && + ($debug_key != "action_chk_lst") && + ($debug_key != "addr_type") + ) + { + ErrorMessage(__FILE__ . ":" . __LINE__ . ": " . "WARNING: The following query key has not been implemented, yet: \"" . $debug_key . "\".<BR>\n" . "Report it to the BASE developers, please.<BR>\n"); + $debug_str = "<BR><PRE>\n\n" . debug_print_backtrace() . "\n\n</PRE><BR>\n"; + ErrorMessage($debug_str); + } + } // foreach($debug_array as $debug_key) + } // if (empty($debug_array)) + } // if (isset($debug_array)) + } // if ($debug_mode > 0) /******* </xxx jl debugging> *********/ } + + + function InitState() { RegisterGlobalState(); |