Module: kamailio Branch: 5.5 Commit: 67d888c80f5c9e96da72a1dab234f2a70782f635 URL: https://github.com/kamailio/kamailio/commit/67d888c80f5c9e96da72a1dab234f2a7...
Author: frederic frederic.gaisnon@mmtt.fr Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-03-09T09:09:38+01:00
cplc: manage case where TZ environment variable is not set.
(cherry picked from commit 2ea56a4cf40045bb92b1f17f5a0b8c172da4f866)
---
Modified: src/modules/cplc/cpl_switches.h
---
Diff: https://github.com/kamailio/kamailio/commit/67d888c80f5c9e96da72a1dab234f2a7... Patch: https://github.com/kamailio/kamailio/commit/67d888c80f5c9e96da72a1dab234f2a7...
---
diff --git a/src/modules/cplc/cpl_switches.h b/src/modules/cplc/cpl_switches.h index c3c8572f4c..e2d15bfbb3 100644 --- a/src/modules/cplc/cpl_switches.h +++ b/src/modules/cplc/cpl_switches.h @@ -815,7 +815,7 @@ static inline char *run_time_switch( struct cpl_interpreter *intr ) /* does the recv_time match the specified interval? */ j = cpl_check_tmrec( &trt, &att, 0); /* restore the orig TZ */ - if ( flags&(1<<7) ) + if ((flags&(1<<7)) && cpl_env.orig_tz.s && (cpl_env.orig_tz.len > 3)) set_TZ(cpl_env.orig_tz.s); /* reset flags */ flags &= (1<<7); @@ -850,7 +850,7 @@ static inline char *run_time_switch( struct cpl_interpreter *intr ) cpl_tmrec_free( &trt ); return DEFAULT_ACTION; runtime_error: - if ( flags&(1<<7) ) + if ((flags&(1<<7)) && cpl_env.orig_tz.s && (cpl_env.orig_tz.len > 3)) set_TZ(cpl_env.orig_tz.s); cpl_ac_tm_free( &att ); cpl_tmrec_free( &trt ); @@ -859,7 +859,7 @@ static inline char *run_time_switch( struct cpl_interpreter *intr ) LM_ERR("error parsing attr [%d][%s]\n", attr_name,attr_str?(char*)attr_str:"NULL"); script_error: - if ( flags&(1<<7) ) + if ((flags&(1<<7)) && cpl_env.orig_tz.s && (cpl_env.orig_tz.len > 3)) set_TZ(cpl_env.orig_tz.s); cpl_ac_tm_free( &att ); cpl_tmrec_free( &trt );