[asterisk-commits] Fix buffer overflow in slin sample frames generation. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 1 16:08:29 CDT 2015


Mark Michelson has submitted this change and it was merged.

Change subject: Fix buffer overflow in slin sample frames generation.
......................................................................


Fix buffer overflow in slin sample frames generation.

The length of frames retured by sample functions was twice as large as
real, what caused global buffer overflow caught by AddressSanitizer.

ASTERISK-24717 #close
Reported by: Badalian Vyacheslav

Change-Id: Iec2fe682aef13e556684912f906bedf7c18229c6
---
M include/asterisk/slin.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved; Verified
  Richard Mudgett: Looks good to me, but someone else must approve



diff --git a/include/asterisk/slin.h b/include/asterisk/slin.h
index 148ee09..9766374 100644
--- a/include/asterisk/slin.h
+++ b/include/asterisk/slin.h
@@ -62,7 +62,7 @@
 {
 	static struct ast_frame f = {
 		.frametype = AST_FRAME_VOICE,
-		.datalen = sizeof(ex_slin8) * 2,
+		.datalen = sizeof(ex_slin8),
 		.samples = ARRAY_LEN(ex_slin8),
 		.mallocd = 0,
 		.offset = 0,
@@ -79,7 +79,7 @@
 {
 	static struct ast_frame f = {
 		.frametype = AST_FRAME_VOICE,
-		.datalen = sizeof(ex_slin16) * 2,
+		.datalen = sizeof(ex_slin16),
 		.samples = ARRAY_LEN(ex_slin16),
 		.mallocd = 0,
 		.offset = 0,

-- 
To view, visit https://gerrit.asterisk.org/555
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec2fe682aef13e556684912f906bedf7c18229c6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Ivan Poddubny <ivan.poddubny at gmail.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list