summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libaddns/dns.h4
-rw-r--r--source3/libaddns/dnsgss.c6
-rw-r--r--source3/libaddns/dnsrecord.c24
-rw-r--r--source3/libaddns/dnsrequest.c6
-rw-r--r--source3/libaddns/dnsresponse.c24
-rw-r--r--source3/libaddns/dnssock.c12
-rw-r--r--source3/libaddns/dnsupdate.c12
-rw-r--r--source3/libaddns/dnsuprequest.c10
-rw-r--r--source3/libaddns/dnsupresp.c18
-rw-r--r--source3/libaddns/dnsutils.c13
10 files changed, 67 insertions, 62 deletions
diff --git a/source3/libaddns/dns.h b/source3/libaddns/dns.h
index bdc7cb24de..b4c9100393 100644
--- a/source3/libaddns/dns.h
+++ b/source3/libaddns/dns.h
@@ -428,8 +428,8 @@ void DNSRecordGenerateOffsets( DNS_RR_RECORD * pDNSRecord );
int32 MapDNSResponseCodes( int16 wResponseCode );
int32 GetLastError( void );
int32 WSAGetLastError( void );
-int32 DNSAllocateMemory(int32 dwSize, void * * ppMemory);
-int32 DNSReallocMemory(void * pMemory, void * * ppNewMemory, int32 dwSize);
+int32 DNSAllocateMemory(int32 dwSize, void * ppMemory);
+int32 DNSReallocMemory(void * pMemory, void * ppNewMemory, int32 dwSize);
void DNSFreeMemory( void * pMemory );
int32 DNSAllocateString(char *pszInputString, char **ppszOutputString);
void DNSFreeString(char * pszString);
diff --git a/source3/libaddns/dnsgss.c b/source3/libaddns/dnsgss.c
index b4c1500661..862f5e7b58 100644
--- a/source3/libaddns/dnsgss.c
+++ b/source3/libaddns/dnsgss.c
@@ -321,7 +321,7 @@ int32 DNSGetTKeyData( DNS_RR_RECORD * pTKeyRecord,
sizeof( int16 ) );
wKeyDataSize = ntohs( wnKeyDataSize );
- dwError = DNSAllocateMemory( wKeyDataSize, ( void ** ) &pKeyData );
+ dwError = DNSAllocateMemory( wKeyDataSize, ( void * ) &pKeyData );
BAIL_ON_ERROR( dwError );
memcpy( pKeyData, pTKeyRecord->pRData + dwKeyDataOffset,
@@ -444,7 +444,7 @@ int32 DNSNegotiateSecureContext( HANDLE hDNSServer,
if ( output_desc.length != 0 ) {
dwError = DNSBuildTKeyQueryRequest( szKeyName,
- output_desc.
+ (uint8 *)output_desc.
value,
output_desc.
length,
@@ -475,7 +475,7 @@ int32 DNSNegotiateSecureContext( HANDLE hDNSServer,
if ( output_desc.length != 0 ) {
dwError = DNSBuildTKeyQueryRequest( szKeyName,
- output_desc.
+ (uint8 *)output_desc.
value,
output_desc.
length,
diff --git a/source3/libaddns/dnsrecord.c b/source3/libaddns/dnsrecord.c
index 704d747ee9..2b0c902d1c 100644
--- a/source3/libaddns/dnsrecord.c
+++ b/source3/libaddns/dnsrecord.c
@@ -39,7 +39,7 @@ int32 DNSCreateDeleteRecord( char *szHost, int16 wClass,
BAIL_ON_ERROR( dwError );
dwError = DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
pDNSRRRecord->RRHeader.dwTTL = 0;
@@ -81,7 +81,7 @@ int32 DNSCreateARecord( char *szHost, int16 wClass,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
pDNSRRRecord->RRHeader.wType = wType;
@@ -96,7 +96,7 @@ int32 DNSCreateARecord( char *szHost, int16 wClass,
pDNSRRRecord->RRHeader.wRDataSize = sizeof( int32 );
dwError =
DNSAllocateMemory( sizeof( int32 ),
- ( void ** ) &pRData );
+ ( void * ) &pRData );
dwnIP = htonl( dwIP );
memcpy( pRData, &dwnIP, sizeof( int32 ) );
pDNSRRRecord->pRData = pRData;
@@ -151,7 +151,7 @@ int32 DNSCreateTKeyRecord( char *szKeyName, uint8 * pKeyData,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRecord );
+ ( void * ) &pDNSRecord );
BAIL_ON_ERROR( dwError );
dwError = DNSDomainNameFromString( szKeyName, &pDomainName );
@@ -181,7 +181,7 @@ int32 DNSCreateTKeyRecord( char *szKeyName, uint8 * pKeyData,
sizeof( wKeySize ) + wKeySize + sizeof( wOtherSize ) +
wOtherSize;
- dwError = DNSAllocateMemory( dwRDataSize, ( void ** ) &pRData );
+ dwError = DNSAllocateMemory( dwRDataSize, ( void * ) &pRData );
BAIL_ON_ERROR( dwError );
dwnInception = htonl( dwInception );
@@ -277,7 +277,7 @@ int32 DNSCreateTSIGRecord( char *szKeyName, int32 dwTimeSigned,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRecord );
+ ( void * ) &pDNSRecord );
BAIL_ON_ERROR( dwError );
dwError = DNSDomainNameFromString( szKeyName, &pDomainName );
@@ -303,7 +303,7 @@ int32 DNSCreateTSIGRecord( char *szKeyName, int32 dwTimeSigned,
wMacSize + sizeof( wOriginalID ) + sizeof( wError ) +
sizeof( wOtherLen );
- dwError = DNSAllocateMemory( dwRDataSize, ( void ** ) &pRData );
+ dwError = DNSAllocateMemory( dwRDataSize, ( void * ) &pRData );
BAIL_ON_ERROR( dwError );
/* Convert t to 48 bit network order */
@@ -387,7 +387,7 @@ int32 DNSCreateQuestionRecord( char *pszQName, int16 wQType,
dwError =
DNSAllocateMemory( sizeof( DNS_QUESTION_RECORD ),
- ( void ** ) &pDNSQuestionRecord );
+ ( void * ) &pDNSQuestionRecord );
BAIL_ON_ERROR( dwError );
pDNSQuestionRecord->pDomainName = pDomainName;
@@ -423,7 +423,7 @@ int32 DNSCreateZoneRecord( char *pszZName, DNS_ZONE_RECORD ** ppDNSZoneRecord )
dwError =
DNSAllocateMemory( sizeof( DNS_ZONE_RECORD ),
- ( void ** ) &pDNSZoneRecord );
+ ( void * ) &pDNSZoneRecord );
BAIL_ON_ERROR( dwError );
pDNSZoneRecord->pDomainName = pDomainName;
@@ -469,7 +469,7 @@ int32 DNSCreateNameInUseRecord( char *pszName, int32 qtype,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
pDNSRRRecord->RRHeader.pDomainName = pDomainName;
@@ -484,7 +484,7 @@ int32 DNSCreateNameInUseRecord( char *pszName, int32 qtype,
pDNSRRRecord->RRHeader.wRDataSize = 4;
dwError =
DNSAllocateMemory( 4,
- ( void ** ) &pDNSRRRecord->
+ ( void * ) &pDNSRRRecord->
pRData );
BAIL_ON_ERROR( dwError );
memcpy( pDNSRRRecord->pRData, &ip->s_addr, 4 );
@@ -521,7 +521,7 @@ int32 DNSCreateNameNotInUseRecord( char *pszName, int32 qtype,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
pDNSRRRecord->RRHeader.pDomainName = pDomainName;
diff --git a/source3/libaddns/dnsrequest.c b/source3/libaddns/dnsrequest.c
index 3dd402981f..d92b0737d3 100644
--- a/source3/libaddns/dnsrequest.c
+++ b/source3/libaddns/dnsrequest.c
@@ -398,7 +398,7 @@ int32 DNSStdAddQuestionSection( DNS_REQUEST * pDNSRequest,
dwNumQuestions = pDNSRequest->wQuestions;
dwError = DNSReallocMemory( ( uint8 * ) pDNSRequest->ppQuestionRRSet,
- ( void ** ) &pDNSRequest->ppQuestionRRSet,
+ ( void * ) &pDNSRequest->ppQuestionRRSet,
( dwNumQuestions +
1 ) * sizeof( DNS_QUESTION_RECORD * )
);
@@ -424,7 +424,7 @@ int32 DNSStdAddAdditionalSection( DNS_REQUEST * pDNSRequest,
dwNumAdditionals = pDNSRequest->wAdditionals;
dwError = DNSReallocMemory( pDNSRequest->ppAdditionalRRSet,
- ( void ** ) &pDNSRequest->
+ ( void * ) &pDNSRequest->
ppAdditionalRRSet,
( dwNumAdditionals +
1 ) * sizeof( DNS_RR_RECORD * ) );
@@ -453,7 +453,7 @@ int32 DNSStdCreateStdRequest( DNS_REQUEST ** ppDNSRequest )
#endif
dwError =
DNSAllocateMemory( sizeof( DNS_REQUEST ),
- ( void ** ) &pDNSRequest );
+ ( void * ) &pDNSRequest );
BAIL_ON_ERROR( dwError );
dwError = DNSGenerateIdentifier( &pDNSRequest->wIdentification );
diff --git a/source3/libaddns/dnsresponse.c b/source3/libaddns/dnsresponse.c
index 65a8853049..9a5ff7dee7 100644
--- a/source3/libaddns/dnsresponse.c
+++ b/source3/libaddns/dnsresponse.c
@@ -36,7 +36,7 @@ static int32 DNSStdAllocateResponse( DNS_RESPONSE ** ppDNSResponse )
dwError =
DNSAllocateMemory( sizeof( DNS_RESPONSE ),
- ( void ** ) &pDNSResponse );
+ ( void * ) &pDNSResponse );
BAIL_ON_ERROR( dwError );
*ppDNSResponse = pDNSResponse;
@@ -70,14 +70,14 @@ static int32 DNSStdUnmarshallQuestionSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( wQuestions *
sizeof( DNS_QUESTION_RECORD * ),
- ( void ** ) &ppDNSQuestionRecords );
+ ( void * ) &ppDNSQuestionRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wQuestions; i++ ) {
dwError =
DNSAllocateMemory( sizeof( DNS_QUESTION_RECORD ),
- ( void ** ) &pDNSQuestionRecord );
+ ( void * ) &pDNSQuestionRecord );
BAIL_ON_ERROR( dwError );
dwError =
@@ -130,7 +130,7 @@ static int32 DNSStdUnmarshallAnswerSection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wAnswers * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSAnswerRRRecords );
+ ( void * ) &ppDNSAnswerRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wAnswers; i++ ) {
@@ -148,7 +148,7 @@ static int32 DNSStdUnmarshallAnswerSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -185,7 +185,7 @@ static int32 DNSStdUnmarshallAuthoritySection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wAuthoritys * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSAuthorityRRRecords );
+ ( void * ) &ppDNSAuthorityRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wAuthoritys; i++ ) {
@@ -202,7 +202,7 @@ static int32 DNSStdUnmarshallAuthoritySection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -240,7 +240,7 @@ static int32 DNSStdUnmarshallAdditionalSection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wAdditionals * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSAdditionalRRRecords );
+ ( void * ) &ppDNSAdditionalRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wAdditionals; i++ ) {
@@ -257,7 +257,7 @@ static int32 DNSStdUnmarshallAdditionalSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -467,7 +467,7 @@ int32 DNSUnmarshallDomainName( HANDLE hRecvBuffer, DNS_DOMAIN_NAME ** ppDomainNa
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_LABEL ),
- ( void ** ) &pLabel );
+ ( void * ) &pLabel );
BAIL_ON_ERROR( dwError );
pLabel->pszLabel = pszLabel;
@@ -481,7 +481,7 @@ int32 DNSUnmarshallDomainName( HANDLE hRecvBuffer, DNS_DOMAIN_NAME ** ppDomainNa
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_NAME ),
- ( void ** ) &pDomainName );
+ ( void * ) &pDomainName );
BAIL_ON_ERROR( dwError );
pDomainName->pLabelList = pLabelList;
@@ -552,7 +552,7 @@ int32 DNSUnmarshallRData( HANDLE hRecvBuffer,
int32 dwError = 0;
uint8 *pMemory = NULL;
- dwError = DNSAllocateMemory( dwSize, ( void ** ) &pMemory );
+ dwError = DNSAllocateMemory( dwSize, ( void * ) &pMemory );
BAIL_ON_ERROR( dwError );
dwError =
DNSUnmarshallBuffer( hRecvBuffer, ( uint8 * ) pMemory, dwSize,
diff --git a/source3/libaddns/dnssock.c b/source3/libaddns/dnssock.c
index 713d56c703..88bd44e0e2 100644
--- a/source3/libaddns/dnssock.c
+++ b/source3/libaddns/dnssock.c
@@ -368,12 +368,12 @@ int32 DNSCreateSendBuffer( HANDLE * phDNSSendBuffer )
uint8 *pSendBuffer = NULL;
dwError = DNSAllocateMemory( sizeof( DNS_SENDBUFFER_CONTEXT ),
- ( void ** ) &pDNSContext );
+ ( void * ) &pDNSContext );
BAIL_ON_ERROR( dwError );
dwError =
DNSAllocateMemory( SENDBUFFER_SIZE,
- ( void ** ) &pSendBuffer );
+ ( void * ) &pSendBuffer );
BAIL_ON_ERROR( dwError );
pDNSContext->pSendBuffer = pSendBuffer;
@@ -587,12 +587,12 @@ int32 DNSCreateReceiveBuffer( HANDLE * phDNSRecvBuffer )
uint8 *pRecvBuffer = NULL;
dwError = DNSAllocateMemory( sizeof( DNS_RECEIVEBUFFER_CONTEXT ),
- ( void ** ) &pDNSContext );
+ ( void * ) &pDNSContext );
BAIL_ON_ERROR( dwError );
dwError =
DNSAllocateMemory( RECVBUFFER_SIZE,
- ( void ** ) &pRecvBuffer );
+ ( void * ) &pRecvBuffer );
BAIL_ON_ERROR( dwError );
pDNSContext->pRecvBuffer = pRecvBuffer;
@@ -684,7 +684,7 @@ int32 DNSUnmarshallDomainNameAtOffset( HANDLE hRecvBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_LABEL ),
- ( void ** ) &pLabel );
+ ( void * ) &pLabel );
BAIL_ON_ERROR( dwError );
pLabel->pszLabel = pszLabel;
@@ -694,7 +694,7 @@ int32 DNSUnmarshallDomainNameAtOffset( HANDLE hRecvBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_NAME ),
- ( void ** ) &pDomainName );
+ ( void * ) &pDomainName );
BAIL_ON_ERROR( dwError );
pDomainName->pLabelList = pLabelList;
diff --git a/source3/libaddns/dnsupdate.c b/source3/libaddns/dnsupdate.c
index 02c69feac8..36c5cbb13a 100644
--- a/source3/libaddns/dnsupdate.c
+++ b/source3/libaddns/dnsupdate.c
@@ -466,7 +466,7 @@ int32 DNSUpdateGenerateSignature( gss_ctx_id_t * pGSSContext,
dwTimeSigned,
wFudge,
pDNSUpdateRequest->wIdentification,
- MicDesc.value,
+ (uint8 *)MicDesc.value,
MicDesc.length, &pDNSTSIGRecord );
BAIL_ON_ERROR( dwError );
@@ -503,7 +503,7 @@ int32 DNSBuildSignatureBuffer( int32 dwMaxSignatureSize, uint8 ** ppSignature )
uint8 *pSignature = NULL;
dwError = DNSAllocateMemory( dwMaxSignatureSize,
- ( void ** ) &pSignature );
+ ( void * ) &pSignature );
BAIL_ON_ERROR( dwError );
*ppSignature = pSignature;
@@ -579,7 +579,7 @@ int32 DNSBuildMessageBuffer( DNS_UPDATE_REQUEST * pDNSUpdateRequest,
dwError =
DNSAllocateMemory( dwMessageSize,
- ( void ** ) &pMessageBuffer );
+ ( void * ) &pMessageBuffer );
BAIL_ON_ERROR( dwError );
pOffset = pMessageBuffer;
@@ -605,7 +605,11 @@ int32 DNSBuildMessageBuffer( DNS_UPDATE_REQUEST * pDNSUpdateRequest,
memcpy( pOffset, &wnTimePrefix, sizeof( int16 ) );
pOffset += sizeof( int16 );
- time( (time_t*)&dwTimeSigned );
+ {
+ time_t t;
+ time(&t);
+ dwTimeSigned = t;
+ }
dwnTimeSigned = htonl( dwTimeSigned );
memcpy( pOffset, &dwnTimeSigned, sizeof( int32 ) );
pOffset += sizeof( int32 );
diff --git a/source3/libaddns/dnsuprequest.c b/source3/libaddns/dnsuprequest.c
index d8188d5f58..9de5ec88ae 100644
--- a/source3/libaddns/dnsuprequest.c
+++ b/source3/libaddns/dnsuprequest.c
@@ -310,7 +310,7 @@ int32 DNSUpdateAddZoneSection( DNS_UPDATE_REQUEST * pDNSRequest,
dwNumZones = pDNSRequest->wZones;
dwError = DNSReallocMemory( ( uint8 * ) pDNSRequest->ppZoneRRSet,
- ( void ** ) &pDNSRequest->ppZoneRRSet,
+ ( void * ) &pDNSRequest->ppZoneRRSet,
( dwNumZones +
1 ) * sizeof( DNS_ZONE_RECORD * )
);
@@ -336,7 +336,7 @@ int32 DNSUpdateAddAdditionalSection( DNS_UPDATE_REQUEST * pDNSRequest,
dwNumAdditionals = pDNSRequest->wAdditionals;
dwError = DNSReallocMemory( pDNSRequest->ppAdditionalRRSet,
- ( void ** ) &pDNSRequest->
+ ( void * ) &pDNSRequest->
ppAdditionalRRSet,
( dwNumAdditionals +
1 ) * sizeof( DNS_RR_RECORD * ) );
@@ -358,7 +358,7 @@ int32 DNSUpdateAddPRSection( DNS_UPDATE_REQUEST * pDNSRequest,
dwNumPRs = pDNSRequest->wPRs;
dwError = DNSReallocMemory( pDNSRequest->ppPRRRSet,
- ( void ** ) &pDNSRequest->ppPRRRSet,
+ ( void * ) &pDNSRequest->ppPRRRSet,
( dwNumPRs +
1 ) * sizeof( DNS_RR_RECORD * ) );
BAIL_ON_ERROR( dwError );
@@ -383,7 +383,7 @@ int32 DNSUpdateAddUpdateSection( DNS_UPDATE_REQUEST * pDNSRequest,
wNumUpdates = pDNSRequest->wUpdates;
dwError = DNSReallocMemory( pDNSRequest->ppUpdateRRSet,
- ( void ** ) &pDNSRequest->ppUpdateRRSet,
+ ( void * ) &pDNSRequest->ppUpdateRRSet,
( wNumUpdates +
1 ) * sizeof( DNS_RR_RECORD * ) );
BAIL_ON_ERROR( dwError );
@@ -406,7 +406,7 @@ int32 DNSUpdateCreateUpdateRequest( DNS_UPDATE_REQUEST ** ppDNSRequest )
dwError =
DNSAllocateMemory( sizeof( DNS_UPDATE_REQUEST ),
- ( void ** ) &pDNSRequest );
+ ( void * ) &pDNSRequest );
BAIL_ON_ERROR( dwError );
dwError = DNSGenerateIdentifier( &pDNSRequest->wIdentification );
diff --git a/source3/libaddns/dnsupresp.c b/source3/libaddns/dnsupresp.c
index c5f7642acd..26cc9ff8e2 100644
--- a/source3/libaddns/dnsupresp.c
+++ b/source3/libaddns/dnsupresp.c
@@ -36,7 +36,7 @@ static int32 DNSUpdateAllocateResponse( DNS_UPDATE_RESPONSE ** ppDNSResponse )
dwError =
DNSAllocateMemory( sizeof( DNS_UPDATE_RESPONSE ),
- ( void ** ) &pDNSResponse );
+ ( void * ) &pDNSResponse );
BAIL_ON_ERROR( dwError );
*ppDNSResponse = pDNSResponse;
@@ -68,7 +68,7 @@ static int32 DNSUpdateUnmarshallAdditionalSection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wAdditionals * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSAdditionalRRRecords );
+ ( void * ) &ppDNSAdditionalRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wAdditionals; i++ ) {
@@ -85,7 +85,7 @@ static int32 DNSUpdateUnmarshallAdditionalSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -117,7 +117,7 @@ static int32 DNSUpdateUnmarshallPRSection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wPRs * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSPRRRRecords );
+ ( void * ) &ppDNSPRRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wPRs; i++ ) {
@@ -134,7 +134,7 @@ static int32 DNSUpdateUnmarshallPRSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -171,7 +171,7 @@ static int32 DNSUpdateUnmarshallUpdateSection( HANDLE hReceiveBuffer,
int32 dwRead = 0;
dwError = DNSAllocateMemory( wUpdates * sizeof( DNS_RR_RECORD * ),
- ( void ** ) &ppDNSUpdateRRRecords );
+ ( void * ) &ppDNSUpdateRRRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wUpdates; i++ ) {
@@ -188,7 +188,7 @@ static int32 DNSUpdateUnmarshallUpdateSection( HANDLE hReceiveBuffer,
dwError =
DNSAllocateMemory( sizeof( DNS_RR_RECORD ),
- ( void ** ) &pDNSRRRecord );
+ ( void * ) &pDNSRRRecord );
BAIL_ON_ERROR( dwError );
memcpy( &pDNSRRRecord->RRHeader, pRRHeader,
@@ -225,14 +225,14 @@ static int32 DNSUpdateUnmarshallZoneSection( HANDLE hReceiveBuffer,
dwError = DNSAllocateMemory( wZones * sizeof( DNS_ZONE_RECORD * ),
- ( void ** ) &ppDNSZoneRecords );
+ ( void * ) &ppDNSZoneRecords );
BAIL_ON_ERROR( dwError );
for ( i = 0; i < wZones; i++ ) {
dwError =
DNSAllocateMemory( sizeof( DNS_ZONE_RECORD ),
- ( void ** ) &pDNSZoneRecord );
+ ( void * ) &pDNSZoneRecord );
BAIL_ON_ERROR( dwError );
dwError =
diff --git a/source3/libaddns/dnsutils.c b/source3/libaddns/dnsutils.c
index acf81a09c3..7807256381 100644
--- a/source3/libaddns/dnsutils.c
+++ b/source3/libaddns/dnsutils.c
@@ -107,7 +107,7 @@ static int32 DNSMakeLabel( char *szLabel, DNS_DOMAIN_LABEL ** ppLabel )
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_LABEL ),
- ( void ** ) &pLabel );
+ ( void * ) &pLabel );
BAIL_ON_ERROR( dwError );
dwError = DNSAllocateString( szLabel, &pszLabel );
@@ -376,7 +376,7 @@ int32 DNSDomainNameFromString( char *pszDomainName,
dwError =
DNSAllocateMemory( sizeof( DNS_DOMAIN_NAME ),
- ( void ** ) &pDomainName );
+ ( void * ) &pDomainName );
BAIL_ON_ERROR( dwError );
pDomainName->pLabelList = pLabelList;
@@ -509,9 +509,9 @@ int32 MapDNSResponseCodes( int16 wResponseCode )
/*********************************************************************
*********************************************************************/
-int32 DNSAllocateMemory(int32 dwSize, void * * ppMemory)
+int32 DNSAllocateMemory(int32 dwSize, void * _ppMemory)
{
-
+ void **ppMemory = (void **)_ppMemory;
int32 dwError = 0;
void * pMemory = NULL;
@@ -529,8 +529,9 @@ int32 DNSAllocateMemory(int32 dwSize, void * * ppMemory)
/*********************************************************************
*********************************************************************/
-int32 DNSReallocMemory(void * pMemory, void * * ppNewMemory, int32 dwSize)
+int32 DNSReallocMemory(void * pMemory, void * _ppNewMemory, int32 dwSize)
{
+ void **ppNewMemory = (void **)_ppNewMemory;
int32 dwError = 0;
void * pNewMemory = NULL;
@@ -573,7 +574,7 @@ int32 DNSAllocateString(char *pszInputString, char **ppszOutputString)
BAIL_ON_ERROR(dwError);
}
dwLen = (int32)strlen(pszInputString);
- dwError = DNSAllocateMemory(dwLen+1, (void * *)&pszOutputString);
+ dwError = DNSAllocateMemory(dwLen+1, (void *)&pszOutputString);
BAIL_ON_ERROR(dwError);
strcpy(pszOutputString, pszInputString);