[asterisk-bugs] [Asterisk 0011343]: Wrong parsing of application arguments Mysql Fetch

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Dec 4 11:37:12 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11343 
====================================================================== 
Reported By:                wegbert
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11343
Category:                   Addons/app_addon_sql_mysql
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 487 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-21-2007 18:43 CST
Last Modified:              12-04-2007 11:37 CST
====================================================================== 
Summary:                    Wrong parsing of application arguments Mysql Fetch
Description: 
In function aMYSQL_fetch(struct ast_channel *chan, char *data),
after calling  AST_NONSTANDARD_APP_ARGS(args, data, ' ');
in the loop to fetch resultfields,
 s5 = strsep(&datatmp, " ");  is not working.

- It can only find one variable
- It finds really the first argument, instead from starting of with the
fourth.

My work around solutions involves copying 'data' to 'datatmp' (before
calling AST_NONSTANDARD_APP_ARGS), and shifting of the first three
arguments by calling 
strsep(&datatmp, " ");  three times:

strcpy(datatmp,ata);
strsep(&datatmp, " ");
strsep(&datatmp, " ");
strsep(&datatmp, " ");

and then using  s5 = strsep(&datatmp, " "); in the field retrieval loop.

====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 12-04-07 11:37  
---------------------------------------------------------------------- 
I realize I made a slight mistake in my patch, so I am uploading a
corrected version. It's called 11343v2.patch 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-04-07 11:37  putnopvut      Note Added: 0074758                          
======================================================================




More information about the asterisk-bugs mailing list