[Asterisk-code-review] func_frame_drop: Fix typo referencing wrong buffer (asterisk[19])

N A asteriskteam at digium.com
Mon Jan 31 06:32:43 CST 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17931 )


Change subject: func_frame_drop: Fix typo referencing wrong buffer
......................................................................

func_frame_drop: Fix typo referencing wrong buffer

In order to get around the issue of certain frames
having names that could overlap, func_frame_drop
surrounds names with commas for the purposes of
comparison.

The buffer is allocated and printed to properly,
but the original buffer is used for comparison.
In most cases, this wouldn't have had any effect,
but that was not the intention behind the buffer.
This updates the code to reference the modified
buffer instead.

ASTERISK-29854 #close

Change-Id: I430b52e14e712d0e62a23aa3b5644fe958b684a7
---
M funcs/func_frame_drop.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/31/17931/1

diff --git a/funcs/func_frame_drop.c b/funcs/func_frame_drop.c
index 5aa66df..c19c566 100644
--- a/funcs/func_frame_drop.c
+++ b/funcs/func_frame_drop.c
@@ -227,13 +227,13 @@
 	buffer = ast_malloc(sizeof(value) + 3); /* leading and trailing comma and null terminator */
 	snprintf(buffer, sizeof(value) + 2, ",%s,", value);
 	for (i = 0; i < ARRAY_LEN(frametype2str); i++) {
-		if (strcasestr(value, frametype2str[i].str)) {
+		if (strcasestr(buffer, frametype2str[i].str)) {
 			framedata->values[i] = 1;
 		}
 	}
 
 	for (i = 0; i < ARRAY_LEN(controlframetype2str); i++) {
-		if (strcasestr(value, controlframetype2str[i].str)) {
+		if (strcasestr(buffer, controlframetype2str[i].str)) {
 			framedata->controlvalues[i] = 1;
 		}
 	}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17931
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I430b52e14e712d0e62a23aa3b5644fe958b684a7
Gerrit-Change-Number: 17931
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/20220131/f3425362/attachment.html>


More information about the asterisk-code-review mailing list