Skip to content

Commit 7ae8321

Browse files
InterLinked1jcolp
authored andcommitted
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
1 parent 7b15ced commit 7ae8321

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

funcs/func_frame_drop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ static int frame_drop_helper(struct ast_channel *chan, const char *cmd, char *da
227227
buffer = ast_malloc(sizeof(value) + 3); /* leading and trailing comma and null terminator */
228228
snprintf(buffer, sizeof(value) + 2, ",%s,", value);
229229
for (i = 0; i < ARRAY_LEN(frametype2str); i++) {
230-
if (strcasestr(value, frametype2str[i].str)) {
230+
if (strcasestr(buffer, frametype2str[i].str)) {
231231
framedata->values[i] = 1;
232232
}
233233
}
234234

235235
for (i = 0; i < ARRAY_LEN(controlframetype2str); i++) {
236-
if (strcasestr(value, controlframetype2str[i].str)) {
236+
if (strcasestr(buffer, controlframetype2str[i].str)) {
237237
framedata->controlvalues[i] = 1;
238238
}
239239
}

0 commit comments

Comments
 (0)