Add cast to make it clear that this is an intentional truncation of a
time_t to an int.
Change-Id: I676f7eb30d4016a531e94975fb230c2d7c9aa9f7
Warned-by: Coverity
When handling `XMLRPC2DIServer` allocation,
first make sure to have the `XmlRpcServer`
and then do rest of processing (e.g.: `di_export`,
`di_method`, `registerMethods()` etc.)
Otherwise can lead to seg.faults when appealing
to objects via still non-allocated `XmlRpcServer`
object.
Change-Id: Id3395ce3e0d6f2de76ed8caa1a786a6e139a851b
There is no need for a generic timer callback option without good
typing, as we can just subclass the timer class and use our own fire()
method and whatever other class members are needed.
Change-Id: I95cd60277b5b4d3f492389958fa7f2ead921479e
If the dlg object is freed, then don't try to log
things based on the call-id value taken from it.
Just do slightly before.
Change-Id: I09e865ca77d64c6c398cf8dc35c189e076fdb26d
For the `XMLRPC2DIServer` class as well as for the
`XMLRPC2DI` one, heap allocated objects aren't properly
managed by destruction time.
Pointers have to be initialized as NULL, and point
only when allocation was successfull.
Then by a destruction time, check them and free.
Change-Id: I1a31813db254cc4ab0f7ecc7b382fcb3635feee0
There is only one instance of XMLRPC2DI API,
hence only one possible value for a list of
class members, such as:
- XML RPC port for DI
- XML RPC DI server
- variable, which defines, if that's configured
Additionally fixes:
Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member XMLRPCPort
is not initialized in this constructor nor in any functions that it calls.
Change-Id: I0120652220129774137e90d1ad8dfa579cca3202
It has no sense to keep it as `unsigned int`, because
it's used in comparisons with other `time_t` type
variables.
Although it's only used for now in `is_active()`.
Change-Id: Iceda2338d88ba7de38d084001bbfce03da75e452
No need to cast them into `unsigned int`,
especially using the C-style casting.
Fixes:
Use of 32-bit time_t (Y2K38_SAFETY)
store_truncates_time_t: A time_t value is stored in an integer
with too few bits to accommodate it.
The expression time(NULL) is cast to unsigned int.
Change-Id: I0b7ecb86d4941d4441c8e89ade589064693c226e
Use only references to pass parameters to constructor,
otherwise copy operation would be used instead of move.
Same for other class methods.
Fixes:
Variable copied when it could be moved (COPY_INSTEAD_OF_MOVE)
copy_constructor_call: direct_export is passed-by-value as parameter
to std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >::basic_string(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const &),
when it could be moved instead.
...
Change-Id: If4be730292b3329af1d806c8cf8292498428ea61
Fix possible memory leak during loading.
No functional change.
Fixes:
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable s going
out of scope leaks the storage it points to.
Change-Id: Ibed584c7ce82056bf0d4c492d76b78584eb7ac08
Fixes:
Division or modulo by float zero (DIVIDE_BY_ZERO).
divide_by_zero: In function call resampleOutput,
division by expression mixer_sample_rate which may be zero has undefined behavior.
Change-Id: I7f7b8738eb643499dfbf5e830f3904c62ed02b45
Fixes:
cond_cannot_single: Condition output_sample_rate, taking true branch.
Now the value of output_sample_rate cannot be equal to 0.
cannot_single: At condition output_sample_rate,
the value of output_sample_rate cannot be equal to 0
Logically dead code (DEADCODE).
Change-Id: I629cb7fc50b8883a53e7f5cf8d24bd2042b95154
Fixes:
Unchecked return value from library (CHECKED_RETURN).
check_return: Calling fseek(fp, 9L, 0) without checking return value.
This library function may fail and return an error code.
Change-Id: Id7c861a7a78df72968e0755dca47d9a70e736332
Remove `uac_auth_f` from `RegistrationAgentFactory`,
not used.
Fixes:
Uninitialized pointer field (UNINIT_CTOR).
uninit_member: Non-static class member uac_auth_f
is not initialized in this constructor nor in any functions that it calls.
Change-Id: I3e8d0703d8bd7226369248bd87c1449f97e7ac6a
Fixes:
Untrusted allocation size (TAINTED_SCALAR)
tainted_data: Passing tainted expression chunk_size - 16U
to wav_dummyread, which uses it as an allocation size.
Change-Id: Ide2c65c1c6c440b4e5aeb610cbc813631b24a6a6
Fixes:
Unchecked return value from library (CHECKED_RETURN),
check_return: Calling fseek(fp, chunk_size, 1)
without checking return value.
This library function may fail and return an error code.
Change-Id: Ibbf984f66f9efd2fe516efc9ab431a19396fd718
Move determination of absolute expiry time up into insert_timer(), and
make the rest of the code operate on absolute time. Add an extra method
to directly support absolute time.
Change-Id: I0a8dd27d82fb69b5083a6cfab693bfb275738495
We can now move the timer methods specific to the wheeltimer into
private scope and designate the wheeltimer class as friend.
Change-Id: I2b6bda406ff78733f1909948ed14d18d44b6f3c6
Don't store the relative expiry duration in the timer object. Only store
the absolute value. Pass the relative expiry for a new timer as a method
argument when inserting the timer into the tree instead.
No functional/behavioural changes.
Change-Id: I24817b0ac5801a5addf05bf9155fcb31017f2f68
Move some of the timer arming logic out of the wheeltimer and into the
timer class, so that more members can be made private. No functional
changes.
Change-Id: I4f2a10b0a3d9c775ec6cb903c2b82f4aa3219349
There is no reason we cannot directly insert new timers or remove
existing timers from the list of timers without having to delegate it to
the worker thread.
Change-Id: I2e615af83f64ac7e5024d7905432823044afe252
... instead of manually maintaining a linked list.
Store an iterator in the timer object so that it can be directly removed
if needed.
Change-Id: I38f1fbcdc6fe1b36a8adef6a95f36f8902a4f729
Move the timer resolution from a global define to an instance variable.
Use a default of the previous value. Switch all expiry values from
resolution-based to microseconds, and use 64-bit ints for all values.
Changes
timer::arm_absolute(u_int32_t wall_clock)
to
timer::arm()
Change-Id: I431220f378b4a9d2bd0f047d091ee5c8b3b72bfc
Don't use the `B2BgetHeaderReply()`, it's based on
last received positive reply (200OK), so quite useless
for provisional replies processing (18X).
Thus e.g. for 180 Ringing handling it will never
return anything, because it has no data to parse.
Instead cast event into B2BSipReplyEvent and
parse headers from there.
Change-Id: I4bc4ad5d3aebd7b9ea497bcd53f63736e89d61db
This makes it possible to retain the previously set absolute expiry
time. Update trans_timer to use this (the only relevant place).
Change-Id: I9765fbeddd2807406d2603b3c7fd9e8c9c09db68
Introduce `ILOG_DLG()` call-id logging based on `dlg`.
This commit only introduces a usage of it for
CallLeg and SBCCallLeg classes.
Later commits will spread this usage over all
AmB2BSession based classes.
Change-Id: I18ad8ba5129cb8912f401bb089ad82dbf9909a18
Compilation/installation guide introduced.
Usage guide added as a file only and placed
in docs hierarchy, but still not filled in.
Change-Id: Ia97d1d1595e21c2bc8d6c0fa3916e163868c38ce
From MySQL (mariadb) release notes:
"Incompatible Change: The my_bool type is no longer used in MySQL source code.
Any third-party code that used this type to represent C boolean variables
should use the bool or int C type instead.
The change from my_bool to bool means that the mysql.h header file
now requires a C++ or C99 compiler to compile. "
Fixes:
SW_Vsc.cpp: In member function ‘virtual void SW_VscDialog::onInvite(const AmSipRequest&)’:
SW_Vsc.cpp:913:5: error: ‘my_bool’ was not declared in this scope; did you mean ‘bool’?
913 | my_bool recon = 1;
| ^~~~~~~
| bool
SW_Vsc.cpp:981:57: error: ‘recon’ was not declared in this scope
981 | if (mysql_options(my_handler, MYSQL_OPT_RECONNECT, &recon) != 0)
| ^~~~~
make: *** [../../core/plug-in/Makefile.app_module:83: SW_Vsc.o] Error 1
Change-Id: I74bc973299223fd00236569e905a57882b055f1a
For the `AmThreadLocalStorage` its static `t` member
must be explicitely initialized outside of the template class.
Because it is a template class, it will only be instantiated
when used (when the data type is known), if no initialization
of the static member provided, then linker will fail to link
it (for other users like `RedisCheckpointWriter` which instantiates
`AmThreadLocalStorage` with `RedisConnection`).
Fixes:
ERROR: opening plugin '/usr/lib/sems-pbx/plug-in//redis_store.so':
/usr/lib/sems-pbx/plug-in//redis_store.so: undefined symbol: _ZN20AmThreadLocalStorageI15RedisConnectionE1tE
ERROR: while loading plug-in '/usr/lib/sems-pbx/plug-in//redis_store.so'
Change-Id: Iad3072c07fd04c5341838bb2a2c08858ca94b03a
Replace occurences of escaped CRLF used in
the hdrs value passed to the function.
This allows to pass multiple headers to the function,
whereas each header has `\r\n` at the end
(but the DSM script will always make it escaped,
hence the code must take care of it).
Change-Id: Ie76b44ff0f2d76105691aad6dbb5eb8d7dfb628a