Skip Menu |

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

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

People
Owner: MIKEM [...] cpan.org
Requestors: g.esp [...] free.fr
Cc:
AdminCc:

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



CC: g esp <g.esp [...] free.fr>
Subject: Net-SSLeay-1.48 strncpy warning fix
Date: Mon, 30 Jul 2012 10:00:57 +0200 (CEST)
To: bug-Net-SSLeay [...] rt.cpan.org
From: g.esp [...] free.fr
Compiling with gcc-4.4 and -Wall show this warning (and some others I didn't look at) SSLeay.xs: In function 'next_proto_helper_AV2protodata': SSLeay.xs:740: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness /usr/include/bits/string3.h:118: note: expected 'char * __restrict__' but argument is of type 'unsigned char *' Casting to (char *) suppress the warning but I am unsure this is the right fix. --- Net-SSLeay-1.48/SSLeay.xs.orig 2012-07-29 14:37:13.000000000 +0200 +++ Net-SSLeay-1.48/SSLeay.xs 2012-07-29 17:42:28.000000000 +0200 @@ -737,7 +737,7 @@ if (out) { /* if out == NULL we only calculate the length of output */ out[ptr] = (unsigned char)len; - strncpy(out+ptr+1, p, len); + strncpy((char *)(out+ptr+1), p, len); } ptr += strlen(p) + 1; } Patch is attached too in case it is mangled Another way is changing (and all depending code) - int next_proto_helper_AV2protodata(AV * list, unsigned char *out) + int next_proto_helper_AV2protodata(AV * list, char *out) but I don't know the range that should support len/next_proto_data Gilles

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #78659] Net-SSLeay-1.48 strncpy warning fix
Date: Mon, 30 Jul 2012 21:48:49 +1000
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] open.com.au>
Hi, Thanks for reporting this. Now fixed in SVN 347 Cheers. On Monday, July 30, 2012 04:01:29 AM g.esp@free.fr via RT wrote: Show quoted text
> Mon Jul 30 04:01:27 2012: Request 78659 was acted upon. > Transaction: Ticket created by g.esp@free.fr > Queue: Net-SSLeay > Subject: Net-SSLeay-1.48 strncpy warning fix > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: g.esp@free.fr > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78659 > > > > Compiling with gcc-4.4 and -Wall show this warning (and some others I didn't > look at) > > SSLeay.xs: In function 'next_proto_helper_AV2protodata': > SSLeay.xs:740: warning: pointer targets in passing argument 1 of 'strncpy' > differ in signedness /usr/include/bits/string3.h:118: note: expected 'char > * __restrict__' but argument is of type 'unsigned char *' > > Casting to (char *) suppress the warning but I am unsure this is the right > fix. > > --- Net-SSLeay-1.48/SSLeay.xs.orig 2012-07-29 14:37:13.000000000 +0200 > +++ Net-SSLeay-1.48/SSLeay.xs 2012-07-29 17:42:28.000000000 +0200 > @@ -737,7 +737,7 @@ > if (out) { > /* if out == NULL we only calculate the length of output */ > out[ptr] = (unsigned char)len; > - strncpy(out+ptr+1, p, len); > + strncpy((char *)(out+ptr+1), p, len); > } > ptr += strlen(p) + 1; > } > > Patch is attached too in case it is mangled > > Another way is changing (and all depending code) > - int next_proto_helper_AV2protodata(AV * list, unsigned char *out) > + int next_proto_helper_AV2protodata(AV * list, char *out) > > but I don't know the range that should support len/next_proto_data > > Gilles
-- 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.