[Home]

Summary:ASTERISK-09622: parameter count check for realtime handler
Reporter:Michael J. Maravillo (maravillo)Labels:
Date Opened:2007-06-08 01:04:54Date Closed:2007-06-08 10:52:36
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Can't wait for res_config_sqlite in the next asterisk release so I decided to try it on 1.4.4.  Perhaps this line got munched when http://bugs.digium.com/view.php?id=7790 was merged to trunk.

--- ../../asterisk-trunk/res/res_config_sqlite.c        2007-06-08 13:20:05.000000000 +0900
+++ res_config_sqlite.c 2007-06-08 14:49:29.000000000 +0900
@@ -804,7 +805,7 @@
               params_count++;
       }

-       if (params_count)
+       if (params_count == 0)
               ast_log(LOG_WARNING, "1 parameter and 1 value at least required\n");
       else {  
               *params_ptr = params;
Comments:By: Jason Parker (jparker) 2007-06-08 10:52:36

Fixed in svn trunk in revision 68449.

I took a slightly different approach, because if the count is -1 (the way the code is currently, it can never happen, but we can't know how it may change in the future) bad things were sure to happen.