From 4cbc6017fc14a841e31310db06524c2e1dd6aa2b Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Tue, 9 Aug 2022 17:33:35 +0200 Subject: [PATCH] ITS#9901 libldap: fix non-std printf %p arguments --- libraries/liblber/bprint.c | 6 +++--- libraries/liblber/stdio.c | 1 + libraries/libldap/request.c | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index a82e138570..4b179b107e 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -266,9 +266,9 @@ ber_dump( } sprintf( buf, "ber_dump: buf=%p ptr=%p end=%p len=%ld\n", - ber->ber_buf, - ber->ber_ptr, - ber->ber_end, + (void *) ber->ber_buf, + (void *) ber->ber_ptr, + (void *) ber->ber_end, (long) len ); (void) (*ber_pvt_log_print)( buf ); diff --git a/libraries/liblber/stdio.c b/libraries/liblber/stdio.c index afca4b1039..6550690fad 100644 --- a/libraries/liblber/stdio.c +++ b/libraries/liblber/stdio.c @@ -20,6 +20,7 @@ #include #include #include +#include #if !defined(HAVE_VSNPRINTF) && !defined(HAVE_EBCDIC) /* Write at most n characters to the buffer in str, return the diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 95e402a705..850e31fc8e 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -961,7 +961,7 @@ ldap_do_free_request( void *arg ) Debug3( LDAP_DEBUG_TRACE, "ldap_do_free_request: " "asked to free lr %p msgid %d refcnt %d\n", - lr, lr->lr_msgid, lr->lr_refcnt ); + (void *) lr, lr->lr_msgid, lr->lr_refcnt ); /* if lr_refcnt > 0, the request has been looked up * by ldap_find_request_by_msgid(); if in the meanwhile * the request is free()'d by someone else, just decrease @@ -1008,7 +1008,7 @@ ldap_free_request_int( LDAP *ld, LDAPRequest *lr ) assert( !removed || removed == lr ); Debug3( LDAP_DEBUG_TRACE, "ldap_free_request_int: " "lr %p msgid %d%s removed\n", - lr, lr->lr_msgid, removed ? "" : " not" ); + (void *) lr, lr->lr_msgid, removed ? "" : " not" ); ldap_do_free_request( lr ); } @@ -1673,12 +1673,12 @@ ldap_find_request_by_msgid( LDAP *ld, ber_int_t msgid ) lr->lr_refcnt++; Debug3( LDAP_DEBUG_TRACE, "ldap_find_request_by_msgid: " "msgid %d, lr %p lr->lr_refcnt = %d\n", - msgid, lr, lr->lr_refcnt ); + msgid, (void *) lr, lr->lr_refcnt ); return lr; } Debug2( LDAP_DEBUG_TRACE, "ldap_find_request_by_msgid: " - "msgid %d, lr %p\n", msgid, lr ); + "msgid %d, lr %p\n", msgid, (void *) lr ); return NULL; } @@ -1690,7 +1690,7 @@ ldap_return_request( LDAP *ld, LDAPRequest *lrx, int freeit ) lr = ldap_tavl_find( ld->ld_requests, lrx, ldap_req_cmp ); Debug2( LDAP_DEBUG_TRACE, "ldap_return_request: " - "lrx %p, lr %p\n", lrx, lr ); + "lrx %p, lr %p\n", (void *) lrx, (void *) lr ); if ( lr ) { assert( lr == lrx ); if ( lr->lr_refcnt > 0 ) { -- 2.47.2