Skip Menu |

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 74531
Status: resolved
Worked: 10 min
Priority: 0/
Queue: Net-SSLeay

People
Owner: MIKEM [...] cpan.org
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Invalid conversion between IVs and pointers
At many places Net::SSLeay uses casts pointers to IV like: (IV)pointer
which causes compiler to complain: warning: cast from pointer to integer of different size

Proposal 1: replace (IV)pointer with PTR2IV(pointer) - 14 places in total

Proposal 2: The reverse problem at 3 places + patch:

- cb = (ssleay_ctx_passwd_cb_t*)SvIV( *hash_value );
+ cb = INT2PTR(ssleay_ctx_passwd_cb_t*, SvIV( *hash_value ));

- cb = (ssleay_session_secret_cb_t*)SvIV( *hash_value );
+ cb = INT2PTR(ssleay_session_secret_cb_t*, SvIV( *hash_value ));

- cb = (ssleay_ctx_cert_verify_cb_t*)SvIV( *hash_value );
+ cb = INT2PTR(ssleay_ctx_cert_verify_cb_t*, SvIV( *hash_value ));

--
kmx
Subject: Re: [rt.cpan.org #74531] Invalid conversion between IVs and pointers
Date: Tue, 31 Jan 2012 07:49:18 +1000
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] open.com.au>
Hi, Thanks. Adopted. Now in svn. Cheers. On Monday, January 30, 2012 09:51:21 AM you wrote: Show quoted text
> Mon Jan 30 09:51:19 2012: Request 74531 was acted upon. > Transaction: Ticket created by KMX > Queue: Net-SSLeay > Subject: Invalid conversion between IVs and pointers > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: kmx@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=74531 > > > > At many places Net::SSLeay uses casts pointers to IV like: (IV)pointer > which causes compiler to complain: warning: cast from pointer to integer of > different size > > Proposal 1: replace (IV)pointer with PTR2IV(pointer) - 14 places in total > > Proposal 2: The reverse problem at 3 places + patch: > > - cb = (ssleay_ctx_passwd_cb_t*)SvIV( *hash_value ); > + cb = INT2PTR(ssleay_ctx_passwd_cb_t*, SvIV( *hash_value )); > > - cb = (ssleay_session_secret_cb_t*)SvIV( *hash_value ); > + cb = INT2PTR(ssleay_session_secret_cb_t*, SvIV( *hash_value )); > > - cb = (ssleay_ctx_cert_verify_cb_t*)SvIV( *hash_value ); > + cb = INT2PTR(ssleay_ctx_cert_verify_cb_t*, SvIV( *hash_value )); > > -- > kmx
-- Mike McCauley mikem@open.com.au Open System Consultants Pty. Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au Phone +61 7 5598-7474 Fax +61 7 5598-7070 Radiator: the most portable, flexible and configurable RADIUS server anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.