Closed Deepesh125 closed 4 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
contrib/babelfishpg_tsql/src/collation.c | 12 | 14 | 85.71% | ||
<!-- | Total: | 12 | 14 | 85.71% | --> |
Totals | |
---|---|
Change from base Build 9314670965: | 0.002% |
Covered Lines: | 41723 |
Relevant Lines: | 57002 |
In previous implementation of remove_accents_internal, we were passing input string to utrans_transUChars which will modify the string in place in order to remove the accents. And memory for the input string was also not well allocated in order to accommodate this expansion of string by utrans_transUChars causing the function to write out of allocated heap. This may cause various issues, for example,
This commit fixes the implementation of remove_accents_internal to rightly calculate the capacity and allocate the enough memory to input string to handle possible expansion of the string by utrans_transUChars.
Task: BABEL-5006
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.