[Asterisk-code-review] main/asterisk.c: ast el read char (asterisk[master])
Matt Jordan
asteriskteam at digium.com
Thu Jan 21 17:25:03 CST 2016
Matt Jordan has submitted this change and it was merged.
Change subject: main/asterisk.c: ast_el_read_char
......................................................................
main/asterisk.c: ast_el_read_char
Make sure buf[res] is not accessed at res=-1 (buffer underrun).
Address Sanitizer will complain about this quite loudly.
ASTERISK-24801 #close
Change-Id: Ifcd7f691310815a31756b76067c56fba299d3ae9
---
M main/asterisk.c
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, approved
Corey Farrell: Looks good to me, but someone else must approve
diff --git a/main/asterisk.c b/main/asterisk.c
index a7842a6..ca560cd 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2708,11 +2708,12 @@
console_print(buf, 0);
- if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
+ if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (res >= 2 && buf[res-2] == '\n'))) {
*cp = CC_REFRESH;
return(1);
- } else
+ } else {
lastpos = 1;
+ }
}
}
--
To view, visit https://gerrit.asterisk.org/2032
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifcd7f691310815a31756b76067c56fba299d3ae9
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Diederik de Groot <dkgroot at talon.nl>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Diederik de Groot <dkgroot at talon.nl>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list