[Asterisk-code-review] cdr: Fix 'core show channel' CDR variable truncation. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Fri May 15 10:20:39 CDT 2015


Joshua Colp has submitted this change and it was merged.

Change subject: cdr: Fix 'core show channel' CDR variable truncation.
......................................................................


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
---
M main/cdr.c
1 file changed, 1 insertion(+), 5 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified
  Corey Farrell: Looks good to me, but someone else must approve



diff --git a/main/cdr.c b/main/cdr.c
index 5e24dae..96d055c 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -3096,12 +3096,8 @@
 	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,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I51e610ae87371df771ce7693a955510efb90f8f7
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: snuffy <snuffy22 at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list