[Asterisk-Dev] Patch: fix writing to constant storage regression

Luke Howard lukeh at PADL.COM
Sat May 3 20:26:32 MST 2003


Maybe it would be better to compile with- fwriteable-strings.

Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.19
diff -u -r1.19 pbx.c
--- pbx.c       29 Apr 2003 20:30:08 -0000      1.19
+++ pbx.c       4 May 2003 03:39:00 -0000
@@ -786,7 +786,7 @@
                        ast_shrink_phone_number(num);
                        *ret = num;
                } else
-                       *ret = "";
+                       *ret = workspace;
        } else if (!strcmp(var, "CALLERIDNAME")) {
                if (c->callerid)
                        strncpy(workspace, c->callerid, workspacelen - 1);
@@ -794,7 +794,7 @@
                if (name)
                        *ret = name;
                else
-                       *ret = "";
+                       *ret = workspace;
        } else if (!strcmp(var, "CALLERID")) {
                if (c->callerid) {
                        strncpy(workspace, c->callerid, workspacelen - 1);
--
Luke Howard | PADL Software Pty Ltd | www.padl.com



More information about the asterisk-dev mailing list