]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_osplookup.c: Avoid two format truncations.
authorAlexander Traud <pabstraud@compuserve.com>
Fri, 12 Jan 2018 10:27:23 +0000 (11:27 +0100)
committerAlexander Traud <pabstraud@compuserve.com>
Fri, 12 Jan 2018 10:27:49 +0000 (04:27 -0600)
GCC 7 warned about this.

ASTERISK-27578

Change-Id: I4a00458dbe9b575ef04338b6a7852272745e1552

apps/app_osplookup.c

index ef816c3402ae7995c01520221d36fcc3eb27cf56..eed42c484fec9b44caefebab568a2bfb0e898905 100644 (file)
@@ -2348,7 +2348,7 @@ static int osplookup_exec(
        struct osp_headers headers;
        unsigned int i;
        const char* cinfo[OSP_MAX_CUSTOMINFO] = { NULL };
-       char buffer[OSP_SIZE_TOKSTR];
+       char buffer[OSP_SIZE_TOKSTR + strlen(": ") + strlen(OSP_SIP_HEADER)];
        struct osp_results results;
        const char* status;
        char* tmp;
@@ -2634,7 +2634,7 @@ static int ospnext_exec(
        struct ast_var_t* current;
        struct osp_results results;
        OSPE_OPERATOR_NAME type;
-       char buffer[OSP_SIZE_TOKSTR];
+       char buffer[OSP_SIZE_TOKSTR + strlen(": ") + strlen(OSP_SIP_HEADER)];
        unsigned int callidtypes = OSP_CALLID_UNDEF;
        const char* status;
        char* tmp;