mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Compiler fixes for gcc 10
This patch fixes a few compile warnings/errors that now occur when using gcc 10+. Also, the Makefile.rules check to turn off partial inlining in gcc versions greater or equal to 8.2.1 had a bug where it only it only checked against versions with at least 3 numbers (ex: 8.2.1 vs 10). This patch now ensures any version above the specified version is correctly compared. Change-Id: I54718496eb0c3ce5bd6d427cd279a29e8d2825f9
This commit is contained in:
committed by
Friendly Automation
parent
559fa0e89c
commit
3d1bf3c537
@@ -737,6 +737,10 @@ static int decodeOctets
|
||||
nbits -= 8;
|
||||
}
|
||||
|
||||
if (nbits <= 0) {
|
||||
return ASN_OK;
|
||||
}
|
||||
|
||||
/* Copy last partial byte */
|
||||
|
||||
if (nbits >= rshift) {
|
||||
@@ -752,7 +756,7 @@ static int decodeOctets
|
||||
|
||||
pctxt->buffer.bitOffset = 8 - nbitsInLastOctet;
|
||||
}
|
||||
else if (nbits > 0) { /* nbits < rshift */
|
||||
else { /* nbits > 0 && nbits < rshift */
|
||||
pbuffer[i] =
|
||||
pctxt->buffer.data[pctxt->buffer.byteIndex] << lshift;
|
||||
pctxt->buffer.bitOffset = rshift - nbits;
|
||||
@@ -832,8 +836,8 @@ int decodeOpenType
|
||||
|
||||
int decodeSemiConsInteger (OOCTXT* pctxt, ASN1INT* pvalue, ASN1INT lower)
|
||||
{
|
||||
signed char b;
|
||||
unsigned char ub;
|
||||
signed char b = 0;
|
||||
unsigned char ub = 0;
|
||||
ASN1UINT nbytes;
|
||||
int stat;
|
||||
|
||||
|
@@ -389,7 +389,7 @@ int ooSocketAccept (OOSOCKET socket, OOSOCKET *pNewSocket,
|
||||
|
||||
if (destAddr != 0) {
|
||||
if ((host = ast_sockaddr_stringify_addr(&addr)) != NULL)
|
||||
strncpy(destAddr, host, strlen(host));
|
||||
memcpy(destAddr, host, strlen(host) + 1);
|
||||
}
|
||||
if (destPort != 0)
|
||||
*destPort = ast_sockaddr_port(&addr);
|
||||
|
@@ -454,7 +454,7 @@ int ooAcceptH225Connection()
|
||||
call->callToken);
|
||||
|
||||
if (remoteIP[0]) {
|
||||
strncpy(call->remoteIP, remoteIP, strlen(remoteIP));
|
||||
memcpy(call->remoteIP, remoteIP, strlen(remoteIP) + 1);
|
||||
}
|
||||
|
||||
ast_mutex_unlock(&call->Lock);
|
||||
|
Reference in New Issue
Block a user