Summary: | ASTERISK-13478: [patch] FILTER function is not working correctly (patch attached) | ||
Reporter: | Andrei Tanas (andrew53) | Labels: | |
Date Opened: | 2009-01-29 08:51:54.000-0600 | Date Closed: | 2009-01-31 10:41:18.000-0600 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Functions/func_strings |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) func_strings_filter.patch | |
Description: | When the "filter" function loops through "allowed" characters, the pointer is incremented twice in each iteration, which results in skipping every other "allowed" character (unless character ranges are used, in which case the result is also wrong but less predictable. ****** ADDITIONAL INFORMATION ****** Breakpoint 3, ... at func_strings.c:430 430 for (; *(args.allowed) && allowedlen < sizeof(allowed); (args.allowed)++) { (gdb) print args $4 = {argc = 2, argv = 0x40a504d8, allowed = 0x40a50657 "0123456789", string = 0x40a50662 "+155512345678"} (gdb) cont Continuing. Breakpoint 2, filter ... at func_strings.c:459 459 ast_debug(1, "Allowed: %s\n", allowed); (gdb) print allowed $5 = "02468", '\0' <repeats 250 times> | ||
Comments: | By: Benny Amorsen (amorsen) 2009-01-31 08:19:43.000-0600 Thanks for reporting this bug andrew53, I thought I was going crazy. By: Leif Madsen (lmadsen) 2009-01-31 09:31:00.000-0600 Assigned to Corydon76 as he is the function master! :) By: Digium Subversion (svnbot) 2009-01-31 10:40:04.000-0600 Repository: asterisk Revision: 172706 U trunk/funcs/func_strings.c ------------------------------------------------------------------------ r172706 | tilghman | 2009-01-31 10:40:03 -0600 (Sat, 31 Jan 2009) | 7 lines Don't increment the loop, now that incrementing is taken care of by the decoder function. (closes issue ASTERISK-13478) Reported by: andrew53 Patches: func_strings_filter.patch uploaded by andrew53 (license 519) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=172706 By: Digium Subversion (svnbot) 2009-01-31 10:40:53.000-0600 Repository: asterisk Revision: 172707 _U branches/1.6.0/ U branches/1.6.0/funcs/func_strings.c ------------------------------------------------------------------------ r172707 | tilghman | 2009-01-31 10:40:52 -0600 (Sat, 31 Jan 2009) | 14 lines Merged revisions 172706 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r172706 | tilghman | 2009-01-31 10:40:59 -0600 (Sat, 31 Jan 2009) | 7 lines Don't increment the loop, now that incrementing is taken care of by the decoder function. (closes issue ASTERISK-13478) Reported by: andrew53 Patches: func_strings_filter.patch uploaded by andrew53 (license 519) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=172707 By: Digium Subversion (svnbot) 2009-01-31 10:41:17.000-0600 Repository: asterisk Revision: 172708 _U branches/1.6.1/ U branches/1.6.1/funcs/func_strings.c ------------------------------------------------------------------------ r172708 | tilghman | 2009-01-31 10:41:17 -0600 (Sat, 31 Jan 2009) | 14 lines Merged revisions 172706 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r172706 | tilghman | 2009-01-31 10:40:59 -0600 (Sat, 31 Jan 2009) | 7 lines Don't increment the loop, now that incrementing is taken care of by the decoder function. (closes issue ASTERISK-13478) Reported by: andrew53 Patches: func_strings_filter.patch uploaded by andrew53 (license 519) ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=172708 |