No need to do local copy operations, because:
- local copy on stack created
- then another copy on stack created when returning
So this does two copy operations.
Instead just do one during return, this is still covered
with the lock guard.
Additionally: split `getMaxSessionNum()` into getter
and setter, because the name is misleading now.
Hence those callers, who want to get the max session number,
are obligated to also update to the new value.
Change-Id: Icc775d9236d5c80de829c55638e1da47ae095289
Update the usage of the `getParameter()` through
the modules, whereas the default value isn't given.
Change-Id: I4c725639f56b70e5548fa3da321c8452675cdf99
uac_auth: fix 407 auth retry failing due to stuck OA state
When SEMS sent an INVITE with SDP to a peer requiring proxy
authentication, the 407 response was forwarded to the caller
instead of being handled transparently with a retry.
Root cause: AmOfferAnswer::onReplyIn() did not reset the OA state
for error replies (>= 300). After the initial INVITE, OA state
was OA_OfferSent. When the 407 arrived (no SDP body), the state
remained OA_OfferSent. UACAuth then tried to retry the INVITE
with the original SDP body, but onTxSdp() rejected it:
"There is already a pending offer".
Fix: add early return with clearTransitionalState() at the top of
AmOfferAnswer::onReplyIn() for replies with code >= 300, matching
the behavior already present in sems-pbx. This ensures the OA
state is reset to OA_None before UACAuth attempts the retry.
Additionally, store req.r_uri in SIPRequestInfo and use it for
digest URI computation instead of dlg->getRemoteUri(). This
ensures the Authorization uri field always matches the original
Request-URI, as required by RFC 2617, regardless of any dialog
state changes between the initial request and the 407 handler.
Change-Id: I780bc98f193421481156de3f69497d26b893c49d
This module initialises and starts the StatsUDPServer. Stop its worker
when the module is destroyed.
Change-Id: I265d7ee103866a5946b066e4e7d42376e3510cac
The parsing code expect a null-terminated string. Make sure the string
is.
Use correct ssize_t as return value.
Change-Id: I2590dead0db5ca839ebe5fe7506b4edfe524d164
This makes sure we use the system library, with any updates coming from
upstream, including security fixes.
Change-Id: I3bc01b99fa4c5f107d28a819dc0e1c1eac155e91
Use overloading for the various flavours of str2int functions. This has
the benefit of automatically choosing the appropriate function for
aliased types that may be one or the other underlying type, such as
size_t.
Do a mass renaming of all relevant instances.
Change-Id: I7abb6b9031ee53332d2b04a6cba4a6cc667a4807
Do the dummy read in pieces of 4096. This eliminates the need for a
heap-allocated buffer, which in turn eliminates a possible mem leak.
Change-Id: Ibbbd6f2ef1fa315fad94715c65a74426b3448862
Warned-by: Coverity
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
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
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
For the PRACK transcations (e.g. PRACK/401) update the
remote tag as well as route set.
Scope: `AmSipDialog::onRxReplyStatus()`
Additionally: do not reset remote tag during the authentication
process for PRACK methods, in: `UACAuth::onSipReply()`.
Change-Id: Ibd4e4ee737287bab3883b74a32ded6a966ec62ab
Fix instances of make rules not being parallel execution safe, where the
targets declare a list of dependencies which depend on the order they
have been declared to be executed serially, otherwise these can cause
race conditions.
Either move some of the dependencies down into their transitive
dependencies, or rearrange them to call $(MAKE) to force a serial
point. In other instances add missing dependencies to make sure the
objects to install have previously been built.
Change-Id: I21b499557ac5e9faa603841fa1882b58239ee650
Fix for:
fft.c: In function 'WebRtcIsac_Fftradix':
fft.c:338:22: warning: the comparison will always evaluate as 'false' for the address of 'Tmp0' will never be NULL [-Waddress]
338 | if (fftstate->Tmp0 == NULL || fftstate->Tmp1 == NULL || fftstate->Tmp2 == NULL || fftstate->Tmp3 == NULL
| ^~
In file included from fft.h:34,
from fft.c:126:
structs.h:250:10: note: 'Tmp0' declared here
250 | double Tmp0[MAXFFTSIZE];
| ^~~~
fft.c:338:48: warning: the comparison will always evaluate as 'false' for the address of 'Tmp1' will never be NULL [-Waddress]
338 | if (fftstate->Tmp0 == NULL || fftstate->Tmp1 == NULL || fftstate->Tmp2 == NULL || fftstate->Tmp3 == NULL
| ^~
structs.h:251:10: note: 'Tmp1' declared here
251 | double Tmp1[MAXFFTSIZE];
| ^~~~
fft.c:338:74: warning: the comparison will always evaluate as 'false' for the address of 'Tmp2' will never be NULL [-Waddress]
338 | if (fftstate->Tmp0 == NULL || fftstate->Tmp1 == NULL || fftstate->Tmp2 == NULL || fftstate->Tmp3 == NULL
| ^~
structs.h:252:10: note: 'Tmp2' declared here
252 | double Tmp2[MAXFFTSIZE];
| ^~~~
fft.c:338:100: warning: the comparison will always evaluate as 'false' for the address of 'Tmp3' will never be NULL [-Waddress]
338 | if (fftstate->Tmp0 == NULL || fftstate->Tmp1 == NULL || fftstate->Tmp2 == NULL || fftstate->Tmp3 == NULL
| ^~
structs.h:253:10: note: 'Tmp3' declared here
253 | double Tmp3[MAXFFTSIZE];
| ^~~~
fft.c:339:25: warning: the comparison will always evaluate as 'false' for the address of 'Perm' will never be NULL [-Waddress]
339 | || fftstate->Perm == NULL) {
| ^~
structs.h:254:7: note: 'Perm' declared here
254 | int Perm[MAXFFTSIZE];
| ^~~~
Change-Id: I7060e20d532e80f2ec78c04999676c86136ae34a
This was a workaround for Solaris specific issues in the install program
there. The problem is that this can end up generating empty files, that
will not be detected by the packaging system as it will find the file is
present on destination and thus does not need to be installed.
Change-Id: Ib6107957cbf03c4e7da6cf2998d9103224f674d3
It's been noticed that we have an improper implementation,
which attempts to move the pointer to the char array like this:
`input = param_size + 1;`
It's not right, it should be like that:
`input += (param_size + 1);`
Change-Id: Ia924a398cb37a64a06dfa385db6a0409f1e93e82
This commit takes car of the following mistake in the code:
opus.c: In function 'read_param':
opus.c:178:5: warning: statement with no effect [-Wunused-value]
178 | input;
| ^~~~~
opus.c:186:8: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
186 | input=param_size+1;
| ^
opus.c:191:5: warning: statement with no effect [-Wunused-value]
191 | input;
| ^~~~~
opus.c:197:2: warning: statement with no effect [-Wunused-value]
197 | input;
| ^~~~~
opus.c: In function 'decode_format_parameters':
opus.c:257:4: warning: statement with no effect [-Wunused-value]
257 | buffer;
| ^~~~~~
Change-Id: I469d9cc433eaebe5e3ffbe32b963363dd29a2aac
We should deprecate unused variables and functions:
entropy_coding.c:95:14: warning: 'log2_Q10_B' defined but not used [-Wunused-function]
95 | static short log2_Q10_B( int x )
| ^~~~~~~~~~
entropy_coding.c:78:23: warning: 'stepwise' defined but not used [-Wunused-function]
78 | static WebRtc_UWord32 stepwise(WebRtc_Word32 dinQ10) {
| ^~~~~~~~
entropy_coding.c:72:28: warning: 'lbcnQ10' defined but not used [-Wunused-const-variable=]
72 | static const WebRtc_Word32 lbcnQ10 = -402874;
| ^~~~~~~
entropy_coding.c:71:28: warning: 'ccnQ10' defined but not used [-Wunused-const-variable=]
71 | static const WebRtc_Word32 ccnQ10 = 722631;
| ^~~~~~
entropy_coding.c:70:28: warning: 'bcnQ10' defined but not used [-Wunused-const-variable=]
70 | static const WebRtc_Word32 bcnQ10 = -581224;
| ^~~~~~
entropy_coding.c:69:28: warning: 'acnQ10' defined but not used [-Wunused-const-variable=]
69 | static const WebRtc_Word32 acnQ10 = 426;
| ^~~~~~
Change-Id: Ie45a2685c445eb5c7c5bfc75d7bda9ba2ba26a50
This is a fix for the following warning:
entropy_coding.c:101:11: warning: 'WebRtcSpl_NormU32' is static but used in inline function 'log2_Q10_B' which is not static
101 | zeros = WebRtcSpl_NormU32( x );
| ^~~~~~~~~~~~~~~~~
entropy_coding.c:92:10: warning: 'kRPointsQ10' is static but used in inline function 'stepwise' which is not static
92 | return kRPointsQ10[ind];
| ^~~~~~~~~~~
This happens because the inline function has inside it a call
to the static function.
To fix the warning, we just make the `log2_Q10_B()` and `stepwise()` functions
static. It's quite safe, since they are not even in use by anything.
Change-Id: Id6588d85c7d347d5669d6495188e798fe7c70b05
It's been noticed that we are using `memcpy` for copying of the data,
where the source and destination overlaps.
This begets the following warning:
In function 'memcpy',
inlined from 'Decode' at iLBC_decode.c:254:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' accessing 428 bytes at offsets 0 and 160 overlaps 268 bytes at offset 160 [-Wrestrict]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'memcpy',
inlined from 'Decode' at iLBC_decode.c:302:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' accessing 428 bytes at offsets 0 and 160 overlaps 268 bytes at offset 160 [-Wrestrict]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:495,
from iLBC_encode.c:15:
In function 'memcpy',
inlined from 'iLBC_encode' at iLBC_encode.c:311:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' accessing 428 bytes at offsets 0 and 160 overlaps 268 bytes at offset 160 [-Wrestrict]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'memcpy',
inlined from 'iLBC_encode' at iLBC_encode.c:389:16:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin_memcpy' accessing 428 bytes at offsets 0 and 160 overlaps 268 bytes at offset 160 [-Wrestrict]
34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The problem is that `memcpy` should not be used, when dst memory overlaps with src memory.
We should update such usage of `memcpy` and swap it with `memmove`
From the manpage of the `memcpy`:
>> The memory areas should not overlap. Use memmove(3) if the memory areas do overlap.
Change-Id: I5e3e65587fad92c91bb298e4e5415db1fd0c0371
There are cases when calls coming to a subscriber of C5 CE,
is being challenged by this subscriber, the use case for that could be
if for e.g. we have a PBX/SBC connected to NGCP via subscriber's object.
Current implementation of SEMS works so, that in case parameters;
'enable_auth' and 'enable_aleg_auth' are set to value 'yes',
SEMS tries to pass the digest for the calling party.
This leads to the empty 'username' and wrong 'response' parameters of
the Proxy-Authorization header, eventually the Authorization process is failed.
This is to be changed, so in case 'u=', 'p=' and 'd=' have not been
previously sent by the Proxy (in 'P-App-Param:'), or rather they are empty, authentication should be transparent,
hence be processed by the calling side, with no interfer from SEMS into that.
(real ticket number: TT#128701)
Change-Id: I989dbe3ed9d5a1d2ec73cb0ad081254c9b9eca32
Unset Sems internal Session Timers in case B leg doesn't support it
(no Timer in Supported header of 200OK message).
(real ticket number: TT#29926)
Change-Id: Id27748751f36017e12d6ae84bce602a9995f9d34
- Make errors fatal, so that they do not get ignored anymore.
- Use sane make variables that a shell will accept as valid, otherwise
the exports do not work at all.
- Do not use system paths when we should use in-tree ones.
(real ticket number: TT#6850)
Change-Id: I07af8f38cc37c2fa36b6b10559283a7c477d2d36
opus.conf may contain an fmtp line with opus codec parameters,
all in one line, e.g.
maxplaybackrate=16000;stereo=0;useinbandfec=1
supported parameters:
maxplaybackrate
stereo
useinbandfec
(real ticket number: TT#13019)
Change-Id: I74b7a2a6902dbe718785da89c189f4c726a05a7a
- a codec may export with CODEC_WITH_FMT also a payload format negotiation function
negotiate_fmt
- transcoder adds fmt strings to transcoder codecs
- changed codec fmt_description such that the codec returns a pointer to a
description array
Conflicts:
core/plug-in/amr/amr.c
core/plug-in/speex/speex.c
(real ticket number: TT#13019)
Change-Id: I47a18a8ba13fa3c3a693f7ed6ae7f614237480d6