When outbound PRACK is challanged, SEMS is regenerating
the PRACK to proxy duplicating the proxy socket in the
Route header, with the result of:
Route: <sip:127.0.0.1:5062;lr>,
<sip:127.0.0.1:5062;lr=on;ftag=xyz;leg_b=1;did=f85.d281>,
<sip:127.0.0.1;r2=on;lr=on;ftag=xyz;ngcplb=yes>,
<sip:192.168.178.104;r2=on;lr=on;ftag=xyz;ngcplb=yes>
the duplicate "127.0.0.1:5062" is causing routing
issue on proxy, cause loose_route() function removes
only the first element. Then proxy sends PRACK to
itself.
To avoid that, we make sure is SEMS to do not add
the 'outbound_socket' value in the Route header
if that value already exist in the first position.
Change-Id: Id310144d8e77a99111e199358462496c9dd0495c
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
During refreshing of the media for the call leg in the
`CallLeg::adjustOffer()`, when the resume is required,
but the `on_hold` wasn't set before (so is false),
then additionally check, whether the SDP body
(media sessions of `MT_AUDIO` type) has state like:
- sendonly
- recvonly
- inactive
This will properly fix the attributes (like: `a=sendonly`)
in the re-INVITE, which is supposed to resume the session.
Change-Id: I1c45b7db55d2a5174f3fd96f3fcd0201b48345f2
The hiredis library does not provide a direct way
to retrieve the allocated port number.
We hav to retrieve the socket file descriptor (redis_context->fd)
from the `redisContext` structure and using the `getsockname()`
get the local address associated with that socket.
Then the `sin_port` field of the resulting `sockaddr_in` structure
will contain the allocated ephemeral port.
By using `ntohs()`, just convert the port number from network
byte order to host byte order for printing. However make an additional
on-the-go type casting into the `unsigned int` also, to be able to print.
(unsigned int is guaranteed to be at least 16 bits,
so this is not a lossy conversion).
Change-Id: Id2a8e9ee4fad6f28db099323fb68fd2db0bfafc2
This is a partial rework of b67428d.
The patch was always saving the Allow header
from the initial INVITE and replacing the Allow
header in the 200 OK with that.
This fixed an issue with AA, where Allow
header in the 200 OK, generated by the AA, was
empty. But it causes an issue in case of normal
calls between A and B.
In general we want to keep the Allow header in
the 200 OK, if exist.
Instead, we want to add the Allow header in the 200 OK
response in case the 200 OK does not contain
the Allow header. In this case we won't set the
original Allow from the INVITE but instead we will
set a default Allow header (SIP_REPLY_DEFAULT_ALLOW)
containing all the major SIP method.
Change-Id: I6bf5a2cc7e0228f7b99d28963d16c14c463be695
Backport from the upstream to add `lock(mutex)` calls
in order to avoid crash.
Upstream commit: 0af0c924a8fc9638c5b18a4d5799a085ea8132bc
Change-Id: I022b09d2827b41f0785a9c0568c334b8a2af108f
Backport from the upstream to fix NOTIFY to URI.
Upstream commit: c2908dcb50342e3c8400695b43280181a850fc34
Change-Id: Iff9c0d82ab798f4646284de61365422e48c50a59
Backport from the upstream to fix parsing of sip uri,
when display name contains uri scheme characters:
's', 'i', 'p', and ':'
Upstream commit: fe760b5afdb455707ad2ed3ada7f7fbda6b2fd0e
Change-Id: Idf0236ae9ef2be958693d589894d52ea1ed70848
Backport from the upstream to support looking up aliased
interface names.
Upstream commit: a84509091031331159abb199e21701cb6d7e79b1
Change-Id: I557dee742351268737fe69df8991aede531bb57b
Backport from the upstream to handle responses to SIP_METH_CANCEL
in Cancelling state, preventing dialog and session leaks i.e. on timeouts.
Upstream commit: 54025209301bd111d56ffcb6540473c4f5057779
Change-Id: Iab1d5797f1f5bcd70a27c805d96dab7e67bb1749
Backport from the upstream to support libevent-dev >= 2.1.12 .
Upstream commit: b2172dd70c2fe77c46e8427be5e3d0cf222cb049
Change-Id: Iea7e76b33c945cb57b8f2e98c9130ae46665c66c
Backport from the upstream to add support for body content type
application/csta+xml in INVITE and INFO requests/responses.
Upstream commit: 6f67d15c3857c1f8ed5b33615b7f5ff0e12d3a92
Change-Id: I085eda4a10e73139bd4dce4d75def82bf6da1e8d
Backport from the upstream to fix Python versioning.
Upstream commit: e943f98a8d09a06c88eca10d93e51f7a13056e31
Change-Id: Ia7d6b49270c9f3fa3cc7cb8d921334b2afc1db9b
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
Give an exact size of the buf to the `snprintf()` and also treat the
returned value from it to eliminate this warning:
src/XmlRpcValue.cpp: In member function 'std::string XmlRpc::XmlRpcValue::timeToXml() const':
src/XmlRpcValue.cpp:404:53: warning: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
404 | snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
| ^~~~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/c++/10/ext/string_conversions.h:43,
from /usr/include/c++/10/bits/basic_string.h:6545,
from /usr/include/c++/10/string:55,
from src/XmlRpcValue.h:14,
from src/XmlRpcValue.cpp:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: '__builtin___snprintf_chk' output between 18 and 70 bytes into a destination of size 19
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Ic545bbc942715f433610f49286ee9d0f92ee25f6
This commit takes care of the following:
SBCDSMInstance.cpp:55:18: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
55 | throw string("DSM SBC call control "DSM_SBC_CCVAR_START_DIAG" parameter not set (see call profile)'");
|
Change-Id: I9c5ddd5b438d672e29ce0028c00df177adfbfd33
We have to explicitly set the `SdpPayload.type`,
when calling the constructor of it, which only initializes the `SdpPayload.payload_type`.
Just simply set the `SdpPayload.type` to -1.
This fixes the following:
In file included from ../../core/AmRtpStream.h:32,
from ../../core/AmSession.h:31,
from ../../core/AmB2BSession.h:31,
from CallLeg.h:29,
from CallLeg.cpp:27:
../../core/AmSdp.h: In member function 'void CallLeg::acceptPendingInvite(AmSipRequest*)':
../../core/AmSdp.h:130:18: warning: '<anonymous>.SdpPayload::type' may be used uninitialized in this function [-Wmaybe-uninitialized]
130 | : type(other.type), payload_type(other.payload_type),
| ~~~~~~^~~~
Change-Id: I08a9e75396f043dc88d411b9c84296a704d67057
This fixes the warning:
CallLeg.cpp: In member function 'void CallLeg::adjustOffer(AmSdp&)':
CallLeg.cpp:1670:7: warning: 'hm' may be used uninitialized in this function [-Wmaybe-uninitialized]
1670 | if (hm != RecvonlyStream)
| ^~
Change-Id: I7479d1107cb36b733441a3a0ec130658a6786e50
Fix for the:
SBC.cpp:238:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
238 | ERROR("registering "MOD_NAME" application\n");
| ^
SBC.cpp:243:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
243 | ERROR("registering "MOD_NAME" DI interface\n");
| ^
Change-Id: I0199671c027f61f617afc497f2e22cf09e75f78f
Just removal of a few unsed variables:
rtmp.c: In function 'RTMP_ReadPacket':
rtmp.c:2854:7: warning: variable 'didAlloc' set but not used [-Wunused-but-set-variable]
2854 | int didAlloc = FALSE;
| ^~~~~~~~
and this:
rtmp.c:1393:35: warning: 'av_record' defined but not used [-Wunused-const-variable=]
1393 | #define SAVC(x) static const AVal av_##x = AVC(#x)
| ^~~
rtmp.c:1706:1: note: in expansion of macro 'SAVC'
1706 | SAVC(record);
| ^~~~
Change-Id: I8a2bc2c415b44c99b6d881fb7118475f4020c713
The commit fixes this:
JsonRPCServer.cpp: In static member function 'static int JsonRpcServer::processMessage(char*, unsigned int*, JsonrpcPeerConnection*)':
JsonRPCServer.cpp:135:49: warning: enum constant in boolean context [-Wint-in-bool-context]
135 | if (peer->flags && JsonrpcPeerConnection::FL_CLOSE_WRONG_REPLY) {
|
Change-Id: I7894f3e2727e384458ea736ad9555864894b0386
We should provide a proper formation of the timestamp
in the `timeToXml()`. Just unify that in the manner
it's done in the rest of places.
It will fix then this:
src/XmlRpcValue.cpp: In member function 'std::string XmlRpc::XmlRpcValue::timeToXml() const':
src/XmlRpcValue.cpp:404:53: warning: '%02d' directive output may be truncated writing between 2 and 11 bytes into a region of size between 0 and 7 [-Wformat-truncation=]
404 | snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d",
| ^~~~
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/10/cstdio:42,
from /usr/include/c++/10/ext/string_conversions.h:43,
from /usr/include/c++/10/bits/basic_string.h:6545,
from /usr/include/c++/10/string:55,
from src/XmlRpcValue.h:14,
from src/XmlRpcValue.cpp:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: '__builtin___snprintf_chk' output between 18 and 70 bytes into a destination of size 19
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Iadfed6c14e1bdb0c8ed0b8b36b996ed08b129c42
A mistake in the bool of the return in the XmlRpc::tmEq():
src/XmlRpcValue.cpp: In function 'bool XmlRpc::tmEq(const tm&, const tm&)':
src/XmlRpcValue.cpp:144:52: warning: self-comparison always evaluates to true [-Wtautological-compare]
144 | t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday &&
|
Second one should be of the `t2` variable.
Change-Id: I7fbf3b1b2f9becdb14db2e994fb4d0abf0937964
This commit fixes this:
ModSbc.cpp:611:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
611 | ERROR("Could not find "DSM_AVAR_REQUEST" avar for request");
| ^
ModSbc.cpp:616:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
616 | ERROR("Could not find "DSM_AVAR_REQUEST" avar as pointer");
| ^
ModSbc.cpp:622:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
622 | ERROR("Could not find "DSM_AVAR_REQUEST" avar as request");
| ^
ModSbc.cpp:634:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
634 | ERROR("Could not find "DSM_AVAR_REPLY" avar for reply");
| ^
ModSbc.cpp:639:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
639 | ERROR("Could not find "DSM_AVAR_REPLY" avar as pointer");
| ^
ModSbc.cpp:645:11: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
645 | ERROR("Could not find "DSM_AVAR_REPLY" avar as reply");
| ^
Change-Id: I68fe83180b39c34ec365000208527ddc2eff15d4
We have to manually cast the `->len` of type `size_t` to the `int` type,
when it's used for the printing of logs.
Change-Id: I7e116425aecf5ee7e39d8df868edc05b33581014
It's been noticed that in the DSMCall::onInvite() we get this:
DSMCall.cpp: In member function 'virtual void DSMCall::onInvite(const AmSipRequest&)':
DSMCall.cpp:112:34: warning: the compiler can assume that the address of 'req' will never be NULL [-Waddress]
112 | avar[DSM_AVAR_REQUEST] = AmArg(&req);
| ^~~~
DSMCall.cpp:112:34: warning: 'nonnull' argument 'req' compared to NULL [-Wnonnull-compare]
112 | avar[DSM_AVAR_REQUEST] = AmArg(&req);
| ^~~~
Just manage the AmArg construction via the `DSMSipRequest`.
Change-Id: I007e319dd64bf60788efa2d46dfc15b056ee33d7
This commit takes care of this:
../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
../../core/log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
DBRegAgent.cpp:298:4: note: in expansion of macro 'DBG'
298 | DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
| ^~~
DBRegAgent.cpp:298:62: note: format string is defined here
298 | DBG("REGISTER: Triggering for subscriber with object_id=<%d>\n", object_id);
| ~^
| |
| int
| %ld
../../core/log.h:143:30: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
143 | _LOG(L_DBG, error_category " " fmt, ##args)
../../core/log.h:121:45: note: in definition of macro '_LOG'
121 | int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \
| ^~~
../../core/log.h:166:29: note: in expansion of macro 'CAT_DBG'
166 | #define DBG(fmt, args...) CAT_DBG(ERROR_CATEGORY_DGENERAL, fmt, ##args)
| ^~~~~~~
DBRegAgent.cpp:423:7: note: in expansion of macro 'DBG'
423 | DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
| ^~~
DBRegAgent.cpp:423:62: note: format string is defined here
423 | DBG("REGISTER: Triggering for peering with object_id=<%d>\n", object_id);
| ~^
| |
| int
| %ld
Change-Id: I088f9a1a2861d1f7aae7b7cab84ce0e66b3127c2
This commit takes care of this:
DBRegAgent.cpp: In member function 'bool DBRegAgent::loadRegistrations()':
DBRegAgent.cpp:293:24: warning: NULL used in arithmetic [-Wpointer-arith]
293 | if (object_id == NULL || object_id == 0) {
It makes no sense to compare the `object_id` of type long against
the NULL.
Change-Id: I60cdde2dd459dbfa9c7c942cd8f0d111096411e7
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
This commit fixes this warning:
tcp_trsp.cpp: In member function 'virtual void tcp_server_worker::run()':
tcp_trsp.cpp:573:7: warning: ignoring return value of 'int pipe(int*)' declared with attribute 'warn_unused_result' [-Wunused-result]
573 | pipe(fake_fds);
| ~~~~^~~~~~~~~~
Change-Id: I159153c7bad287b9ca9fe25cd775fc79c4de6cf7
This commit fixes the following issue:
In file included from AmConfig.h:31,
from AmSdp.cpp:12:
AmSdp.h: In member function 'void AmSdp::clear()':
AmSdp.h:61:8: warning: '<anonymous>' may be used uninitialized in this function [-Wmaybe-uninitialized]
61 | struct SdpConnection
| ^~~~~~~~~~~~~
AmSdp.h:61:8: warning: '<anonymous>.SdpConnection::ipv4' may be used uninitialized in this function [-Wmaybe-uninitialized]
AmSdp.h:61:8: warning: '<anonymous>.SdpConnection::ipv6' may be used uninitialized in this function [-Wmaybe-uninitialized]
When calling the SdpConnection's constructor in the AmSdp::clear(),
we initialize the `address` member, but not the `ipv4` and `ipv6` members.
Therefore, when the `AmSdp::clear()` is called,
it's possible that the `ipv4` and `ipv6` members of the `SdpConnection` object may contain garbage values.
To fix the issue, we should explicitly initialize
the `ipv4` and `ipv6` members in the default constructor of `SdpConnection`.
With this change, we explicitely initialize the `ipv4` and `ipv6` members to their
default-constructed values, which in this case will be all zeroes.
Additionally: explicitely initialize the `network` and `addrType` to zeroes.
Change-Id: Iaabb4aa2f2fafd0eb83e3f79becc3bd8d54de32e
This commit fixes this:
In file included from sip_parser_async.cpp:1:
sip_parser_async.h: In member function 'void parser_state::reset_hdr_parser()':
sip_parser_async.h:32:37: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct sip_header'; use assignment or value-initialization instead [-Wclass-memaccess]
32 | memset(&hdr,0,sizeof(sip_header));
| ^
In file included from sip_parser_async.h:4,
from sip_parser_async.cpp:1:
parse_header.h:44:8: note: 'struct sip_header' declared here
44 | struct sip_header
| ^~~~~~~~~~
sip_parser_async.cpp: In function 'int parse_headers_async(parser_state*, char*)':
sip_parser_async.cpp:215:36: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct sip_header'; use assignment or value-initialization instead [-Wclass-memaccess]
215 | memset(hdr,0,sizeof(sip_header));
| ^
In file included from sip_parser_async.h:4,
from sip_parser_async.cpp:1:
parse_header.h:44:8: note: 'struct sip_header' declared here
44 | struct sip_header
| ^~~~~~~~~~
In general, using `var1 = {};` approach to initialize/clear a struct is
equivalent to using `memset(var1, 0, sizeof(MyOwnStruct1));`.
So there shouldn't be any big risks associated with swapping one for the other.
The `memset()` may be slightly more efficient in terms of performance,
especially when dealing with array of structures, but in this situation
we are dealing with quite a small struct, which represents: a type, a name and a value.
As long as `var1 = {};` approach is supported by our compiler and
we don't need to initialize a large array of structures (in our case it isn't),
there shouldn't be any big risks associated with swapping one for the other.
Change-Id: I10570b628d3e5a634d764b83f7558d38ecc6a757