<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8382">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Fix handling of maximum length lines in config files.<br><br>When a line is the maximum length "\n" is found at sizeof(buf) - 2 since<br>the last character is actually the null terminator.  In addition if a<br>line was exactly 8190 plus a multiple of 8192 characters long the config<br>parser would skip the following line.<br><br>Additionally fix comment in voicemail.conf sample config.  It previously<br>stated that emailbody can only contain up to 512 characters which is<br>always wrong.  The buffer is normally 8192 characters unless LOW_MEMORY<br>is enabled then it is 512 characters.  The updated comment states that<br>the line can be up to 8190 or 510 characters since the line feed and<br>NULL terminator each use a character.<br><br>ASTERISK-26688 #close<br><br>Change-Id: I80864a0d40d2e2d8cd79d72af52a8f0a3a99c015<br>---<br>M configs/samples/voicemail.conf.sample<br>M main/config.c<br>2 files changed, 5 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/configs/samples/voicemail.conf.sample b/configs/samples/voicemail.conf.sample<br>index c90f851..e4130d3 100644<br>--- a/configs/samples/voicemail.conf.sample<br>+++ b/configs/samples/voicemail.conf.sample<br>@@ -145,8 +145,9 @@<br> ; You can select between two variables by using dialplan functions, e.g.<br> ;     ${IF(${ISNULL(${ORIG_VM_DATE})}?${VM_DATE}:${ORIG_VM_DATE})}<br> ;<br>-; Note: The emailbody config row can only be up to 512 characters due to a<br>-;       limitation in the Asterisk configuration subsystem.<br>+; Note: The emailbody config row can only be up to 8190 characters due to a<br>+;       limitation in the Asterisk configuration subsystem.  If compiled with<br>+;       LOW_MEMORY the limit is 510 characters.<br> ;emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}<br> ; The following definition is very close to the default, but the default shows<br> ; just the CIDNAME, if it is not null, otherwise just the CIDNUM, or "an unknown<br>diff --git a/main/config.c b/main/config.c<br>index 3b56c03..eec6c02 100644<br>--- a/main/config.c<br>+++ b/main/config.c<br>@@ -2197,10 +2197,10 @@<br>                                    lineno++;<br>                                     if (fgets(buf, sizeof(buf), f)) {<br>                                             /* Skip lines that are too long */<br>-                                           if (strlen(buf) == sizeof(buf) - 1 && buf[sizeof(buf) - 1] != '\n') {<br>+                                                if (strlen(buf) == sizeof(buf) - 1 && buf[sizeof(buf) - 2] != '\n') {<br>                                                         ast_log(LOG_WARNING, "Line %d too long, skipping. It begins with: %.32s...\n", lineno, buf);<br>                                                        while (fgets(buf, sizeof(buf), f)) {<br>-                                                         if (strlen(buf) != sizeof(buf) - 1 || buf[sizeof(buf) - 1] == '\n') {<br>+                                                                if (strlen(buf) != sizeof(buf) - 1 || buf[sizeof(buf) - 2] == '\n') {<br>                                                                         break;<br>                                                                }<br>                                                     }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8382">change 8382</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8382"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I80864a0d40d2e2d8cd79d72af52a8f0a3a99c015 </div>
<div style="display:none"> Gerrit-Change-Number: 8382 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>