[OpenSER-Devel] SF.net SVN: openser: [3510] branches/1.3/modules/lcr/lcr_mod.c

Dan Pascu dan at ag-projects.com
Tue Jan 8 20:15:55 UTC 2008


On Tuesday 08 January 2008, Juha Heinanen wrote:
> Dan Pascu writes:
>  > Log Message:
>  > -----------
>  > Fixed a core dump caused by illegal memory access if the rpid AVP
>  > holds an integer value
>
> dan,
>
> thanks for the fix.

You're welcome.

There is another issue you should be aware of. 
I pointed the from_uri_column to an integer column and openser core dumped 
on startup. Looking at the code it seems that the lcr module tries to use 
the columns as it thinks they should be (string in this case) without 
verifying if they are really that type. As a result it tried to access a 
string value while the data was an integer and a memory violation access 
occurred.

I started to fix this, but then I realized that this is only a small part 
of the issue, because almost no column is checked for the type before 
being accessed. Considering that the lcr module allows one to specify 
what column to use for a certain parameter in the db, I think it would be 
a good idea to also verify that they are of the expected type to avoid 
core dumps.

Attached is a small patch that fixes this for the from_uri column. I was 
going to commit this, but then I realized that this fix also needs to be 
applied virtually to all the other columns, so I gave up on committing it 
until a more complete version will be available.
Unfortunately I do not have the time to do such an extensive change right 
now, so I forward this patch to you to be used as a starting point for a 
more complete fix. The patch is against 1.3.0.

-- 
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lcr-column-check.diff
Type: text/x-diff
Size: 1090 bytes
Desc: not available
Url : http://lists.openser.org/pipermail/devel/attachments/20080108/8e325de6/attachment.diff 


More information about the Devel mailing list