[OpenSER-Users] Need help with buffer overflow error

Alex Balashov abalashov at evaristesys.com
Sun May 25 23:11:47 CEST 2008


Hey Pete,

Check out modules/avpops_impl.c:

int ops_dbquery_avps(struct sip_msg* msg, pv_elem_t* query,
                 pvname_list_t* dest)
{
         int printbuf_len;

         if(msg==NULL || query==NULL)
         {
                 LM_ERR("bad parameters\n");
                 return -1;
         }

         printbuf_len = AVP_PRINTBUF_SIZE-1;
         if(pv_printf(msg, query, printbuf, &printbuf_len)<0 || 
printbuf_len<=0)
         {
                 LM_ERR("cannot print the query\n");
                 return -1;
         }

         LM_DBG("query [%s]\n", printbuf);

         if(db_query_avp(msg, printbuf, dest)!=0)
                 return -1;
         return 1;
}

Among other things, these various functions are called with a buffer 
size as the last argument.

         printbuf_len = AVP_PRINTBUF_SIZE-1;

It's defined at the top of the file as a preprocessor macro:

	#define AVP_PRINTBUF_SIZE 1024

-- Alex

Pete Kay wrote:
> Hi,
> 
> When I run a *long* sql query in openser.cfg using avp_db_query, I am 
> getting the following error:
> 
> 
> May 26 02:52:15 [13784] ERROR:core:pv_printf: no more space for text [584]
> May 26 02:52:15 [13784] ERROR:core:pv_printf: buffer overflow -- 
> increase the buffer size...
> May 26 02:52:15 [13784] ERROR:avpops:ops_dbquery_avps: cannot print the 
> query
> 
> How can I increase the buffer size?
> 
> Thanks in advance for your help.
> 
> Regards,
> Pete
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/users


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599




More information about the sr-users mailing list