[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
Wed Oct 29 19:10:28 CDT 2014


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

George Joseph updated ASTERISK-20127:
-------------------------------------

    Comment: was deleted

(was: Try this patch.)

> [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
>            Assignee: 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 was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list