[unixODBC-dev] _check_ini_cache Regression

Joshua Colp jcolp at digium.com
Thu Jun 2 16:53:34 BST 2016

Kia ora,

First time posting here so sorry if this is the incorrect place (since 
I'm discussing a regression and specific code I thought your dev list 
was most appropriate).

In the 2.3.3 release a change was made to the _check_ini_cache function 
in odbcinst/SQLGetPrivateProfileString.c to fix an issue.

The code before the change was:

         if ( nRetBuffer != ini_cache -> buffer_size )

This was changed to:

         if ( nRetBuffer <= ini_cache -> buffer_size )

Unfortunately this has caused a regression where cached entries are not 
actually being used, causing the linked list to grow. In my case 
nRetBuffer is 1024 and ini_cache->buffer_size is 1024 as expected. This 
results in them being evaluated as equal and therefore skipped. Since 
I'm testing an environment where many disconnect/connect attempts are 
occurring at the same time this spirals and the cache grows out of control.

Looking at the code I think the following is the right fix for it but 
I'm still looking to confirm:

         if ( nRetBuffer < ini_cache -> buffer_size )

Eyes and feedback on this would be appreciated.

Cheers and have a great day,

Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

More information about the unixODBC-dev mailing list