[Home]

Summary:ASTERISK-05699: [patch] wrong argument to ast_copy_string
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2005-11-24 16:38:02.000-0600Date Closed:2008-01-15 15:57:49.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_dial
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) dial.diff
Description:in one place (see patch) the third argument of ast_copy_string() is
simply the size of the pointer and not the size of the buffer. This
results in the string being truncated.

All in all, the code is just trying to do a strdup(), and the patch
implements this.

****** ADDITIONAL INFORMATION ******

Note that this file has many instances of
x=strdup(foo)
if (!x)
  ast_log(LOG_WARNING, "Out of memory\n");
<continue processing>
which are better suited to a function given that the warning is not
pointing out a programming error but a run-time system issue.
This will be addressed by a separate patch.
Comments:By: Russell Bryant (russell) 2005-11-25 09:23:59.000-0600

I have fixed this in the v1-2 branch as well as cvs head.

In regards to your comments about the log message about a memory error, I would appreciate your thoughts about my patch in ASTERISK-4869.

Thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:57:47.000-0600

Repository: asterisk
Revision: 7195

U   trunk/ChangeLog
U   trunk/apps/app_dial.c

------------------------------------------------------------------------
r7195 | russell | 2008-01-15 15:57:47 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5699

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

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

By: Digium Subversion (svnbot) 2008-01-15 15:57:49.000-0600

Repository: asterisk
Revision: 7196

U   branches/v1-2/ChangeLog
U   branches/v1-2/apps/app_dial.c

------------------------------------------------------------------------
r7196 | russell | 2008-01-15 15:57:48 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5699

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

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