[asterisk-bugs] [Asterisk 0013574]: [Patch] Fix false string allocation in realtime_pgsql_store where creating INSERT

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Sep 28 16:29:14 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13574 
====================================================================== 
Reported By:                navkumar
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   13574
Category:                   Resources/res_config_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-27 19:10 CDT
Last Modified:              2008-09-28 16:29 CDT
====================================================================== 
Summary:                    [Patch] Fix false string allocation in
realtime_pgsql_store where creating INSERT
Description: 
The realtime store_func does not work properly in res_config_pgsql. When
composing the INSERT statements, sizeof is used instead of strlen for
newparam and newval.  Both of these are of type 'const char *' and this
leads to improper string allocation and editing. 
====================================================================== 

---------------------------------------------------------------------- 
 (0092928) svnbot (reporter) - 2008-09-28 16:29
 http://bugs.digium.com/view.php?id=13574#c92928 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 145076

U   trunk/res/res_config_pgsql.c

------------------------------------------------------------------------
r145076 | tilghman | 2008-09-28 16:29:13 -0500 (Sun, 28 Sep 2008) | 4
lines

Change several improper "sizeof" to "strlen", as sizeof in that context
would
incorrectly use the size of a pointer, rather than the length of a string.
(Closes issue http://bugs.digium.com/view.php?id=13574)

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-28 16:29 svnbot         Checkin                                      
2008-09-28 16:29 svnbot         Note Added: 0092928                          
======================================================================




More information about the asterisk-bugs mailing list