[Asterisk-code-review] app_read: Fix null pointer crash (asterisk[19])
N A
asteriskteam at digium.com
Wed Sep 29 13:05:47 CDT 2021
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16550 )
Change subject: app_read: Fix null pointer crash
......................................................................
app_read: Fix null pointer crash
If the terminator character is explicitly removed,
there is no null pointer check so Asterisk crashes.
This adds the null check to prevent crashes.
ASTERISK-29673 #close
Change-Id: Ie941833e123c3dbfb88371b5de5edbbe065514ac
---
M apps/app_read.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/16550/1
diff --git a/apps/app_read.c b/apps/app_read.c
index dd48f05..bc1df21 100644
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -250,7 +250,7 @@
break;
}
tmp[x++] = res;
- if (strchr(terminator, tmp[x-1])) {
+ if (terminator && strchr(terminator, tmp[x-1])) {
tmp[x-1] = '\0';
status = "OK";
break;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16550
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Ie941833e123c3dbfb88371b5de5edbbe065514ac
Gerrit-Change-Number: 16550
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210929/d13d6fca/attachment.html>
More information about the asterisk-code-review
mailing list