[asterisk-bugs] [JIRA] (ASTERISK-24535) stringfields: Fix regression from fix for unintentional memory retention and another issue exposed by the fix

Corey Farrell (JIRA) noreply at issues.asterisk.org
Tue Nov 18 08:27:29 CST 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Corey Farrell updated ASTERISK-24535:
-------------------------------------

    Status: Open  (was: Triage)

> stringfields: Fix regression from fix for unintentional memory retention and another issue exposed by the fix
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-24535
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24535
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/AstMM
>    Affects Versions: SVN, 1.8.32.0, 11.14.0, 12.7.0, 13.0.0
>            Reporter: Corey Farrell
>            Assignee: Corey Farrell
>
> This addresses a regression in the previous fix that applies to all versions.  When __ast_string_field_ptr_grow is called by ast_string_field_ptr_set_by_fields, it needs to be passed &target, not __p__.  In the current code if __ast_string_field_ptr_grow actually does anything, it will cause *__p__ != target.  Unfortunately in this case *__p__ points to the new address, target to the old.  This may cause too much data to be written to the old space for the string, and this could cause memory corruption.  This was the first thing I noticed when attempting to troubleshoot res/parking/dynamic_parking_variables unit test failure, but did not fix the test.
> Also needed to get the unit test working again is a fix for ast_string_fields_copy in 12+.  The existing code relies on the fact that __ast_string_field_release_active never previously zeroed pool->used, so keeping the existing pointer was ok.  Setting each field to __ast_string_field_empty after releasing the memory seems to resolve the issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list