[Home]

Summary:ASTERISK-12613: [patch] handle_getvariable doesn't initialize workspace
Reporter:Vadim Berezniker (kryptolus)Labels:
Date Opened:2008-08-19 08:17:52Date Closed:2008-10-06 20:19:11
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20080827__bug13340__2.diff.txt
( 1) res_agi.patch
Description:Some functions return 0 but don't put anything in the workspace, in which case handle_getvariable will return the data in the uninitialized buffer back to the client.
Comments:By: Leif Madsen (lmadsen) 2008-08-27 12:08:05

Developer needs to review this patch and commit. Looks pretty simple :)

By: Tilghman Lesher (tilghman) 2008-08-27 12:18:11

Which functions, specifically, are returning 0, but aren't putting anything in the workspace?  That's a bug in the functions, themselves.

By: Tilghman Lesher (tilghman) 2008-08-27 12:57:34

Okay, I think I've found all of the functions that were erroneously returning 0 without having set the buffer.

By: Vadim Berezniker (kryptolus) 2008-08-27 12:58:26

GROUP function.

Although it is a bug in the function, it wouldn't hurt to initialize the buffer. It is actually initialized in other places that read from functions.

By: Tilghman Lesher (tilghman) 2008-08-27 14:11:51

We'd prefer not to, though.  It slows down the process a not-insignificant amount of process time, to do unnecessary initializations.

By: Tilghman Lesher (tilghman) 2008-09-15 16:17:03

We need some testing on this patch.

By: Digium Subversion (svnbot) 2008-10-06 15:41:56

Repository: asterisk
Revision: 146799

U   branches/1.4/apps/app_speech_utils.c
U   branches/1.4/channels/chan_iax2.c
U   branches/1.4/channels/chan_sip.c
U   branches/1.4/funcs/func_callerid.c
U   branches/1.4/funcs/func_cdr.c
U   branches/1.4/funcs/func_curl.c
U   branches/1.4/funcs/func_groupcount.c
U   branches/1.4/funcs/func_math.c
U   branches/1.4/funcs/func_odbc.c
U   branches/1.4/funcs/func_timeout.c
U   branches/1.4/res/res_smdi.c

------------------------------------------------------------------------
r146799 | tilghman | 2008-10-06 15:41:55 -0500 (Mon, 06 Oct 2008) | 8 lines

Dialplan functions should not actually return 0, unless they have modified the
workspace.  To signal an error (and no change to the workspace), -1 should be
returned instead.
(closes issue ASTERISK-12613)
Reported by: kryptolus
Patches:
      20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=146799

By: Digium Subversion (svnbot) 2008-10-06 20:19:11

Repository: asterisk
Revision: 147010

U   team/group/issue8824/funcs/func_callerid.c

------------------------------------------------------------------------
r147010 | rmudgett | 2008-10-06 20:19:10 -0500 (Mon, 06 Oct 2008) | 1 line

Issue ASTERISK-12613 already fixed for this function on this branch
------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=147010