[asterisk-bugs] [JIRA] (ASTERISK-23904) #define AST_MAX_ACCOUNT_CODE 20 causes truncation

Walter Doekes (JIRA) noreply at issues.asterisk.org
Tue Feb 3 04:33:34 CST 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=224721#comment-224721 ] 

Walter Doekes commented on ASTERISK-23904:
------------------------------------------

Sounds good to me.

Note that sippeers.sql already uses 40 characters as limit:
{noformat}
asterisk-11.x-WRITE$ find . -name '*.sql' | xargs grep accountco
./contrib/realtime/mysql/sippeers.sql:      `accountcode` varchar(40) DEFAULT NULL,
./contrib/realtime/mysql/iaxfriends.sql:  `accountcode` varchar(20) NULL, 
./contrib/realtime/postgresql/realtime.sql:accountcode character varying(20) DEFAULT '' NOT NULL,
./contrib/realtime/postgresql/realtime.sql:accountcode character varying(20),
{noformat}

I consider it safe to increase to 41 (40 in the docs) in branch 11 and up.

> #define AST_MAX_ACCOUNT_CODE   20 causes truncation
> ---------------------------------------------------
>
>                 Key: ASTERISK-23904
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23904
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/General
>    Affects Versions: 12.3.2
>            Reporter: Ben Merrills
>
> When using an account code that is 20 chars long, asterisk truncates the account code to 19 chars too allow for tailing '\0'. AS the DB field is 20, and almost all documentation i can find says the max len of the account code is 20, i suggest upping the flag to 21 to allow for the extra char.
> #define AST_MAX_ACCOUNT_CODE   21



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



More information about the asterisk-bugs mailing list