From 091b436007c55fbcc827cceb97a414a172aa36af Mon Sep 17 00:00:00 2001
From: snuffy <snuffy22@gmail.com>
Date: Fri, 15 May 2015 16:54:26 +1000
Subject: [PATCH] cdr: Fix 'core show channel' CDR variable truncation.

When the new Bridging API was implemented, the workspace variable
changed to a malloc'd string, causing sizeof() to always be 8 (char).

Revert back to stored on stack string for workspace.

ASTERISK-25090 #close

Change-Id: I51e610ae87371df771ce7693a955510efb90f8f7
---
 main/cdr.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/main/cdr.c b/main/cdr.c
index 5e24dae1b2..96d055ca09 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -3096,13 +3096,9 @@ int ast_cdr_serialize_variables(const char *channel_name, struct ast_str **buf,
 	struct cdr_object *it_cdr;
 	struct ast_var_t *variable;
 	const char *var;
-	RAII_VAR(char *, workspace, ast_malloc(256), ast_free);
+	char workspace[256];
 	int total = 0, x = 0, i;
 
-	if (!workspace) {
-		return 0;
-	}
-
 	if (!cdr) {
 		RAII_VAR(struct module_config *, mod_cfg,
 			 ao2_global_obj_ref(module_configs), ao2_cleanup);
-- 
GitLab