[asterisk-bugs] [JIRA] (ASTERISK-20127) [Regression] Config.c config_text_file_load() unescapes semicolons ("\; " -> "; ") turning them into comments (corruption) on rewrite of a config file
George Joseph (JIRA)
noreply at issues.asterisk.org
Mon Dec 16 19:21:03 CST 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-20127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Joseph updated ASTERISK-20127:
-------------------------------------
Reviewboard Link: https://reviewboard.asterisk.org/r/3074/
> [Regression] Config.c config_text_file_load() unescapes semicolons ("\;" -> ";") turning them into comments (corruption) on rewrite of a config file
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ASTERISK-20127
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-20127
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/Configuration
> Affects Versions: 10.6.0
> Environment: Fedora 17 x86_64
> Reporter: George Joseph
>
> My customers who use Asterisk GUI have been complaining that their extensions.conf files are becoming corrupted on configuration saves.
> Lines such as
> PAGING_HEADER = Call-Info: \;answer-after=0
> are being rewritten as
> PAGING_HEADER = Call-Info: ;answer-after=0
> On re-read, everything after the now-unescaped semicolon is read as a comment with the result that the file is effectively corrupted (hence severity Major).
> This appears to have been broken with v354657 of config.c (which was an attempt to fix issue ASTERISK-17121). I'm not sure what the commit author's intent was but here's the fragment from main/config.c that caused the issue...
> {noformat}
> @@ -1522,23 +1650,25 @@
> <snip>
> /* Escaped semicolons aren't comments. */
> - new_buf = comment_p + 1;
> + new_buf = comment_p;
> + /* write over the \ and bring the null terminator with us */
> + memmove(comment_p - 1, comment_p, strlen(comment_p) + 1);
> {noformat}
> Reverting this change restores the correct functionality.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list