From: Gisle Aas Date: Fri, 13 Jan 2006 12:10:28 +0000 (+0000) Subject: Fix [perl #38223]; _IOC_SIZE() not always safe. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=301eb2f051a3a075202dfcd6dec00cccb7565496;p=p5sagit%2Fp5-mst-13.2.git Fix [perl #38223]; _IOC_SIZE() not always safe. p4raw-id: //depot/perl@26815 --- diff --git a/perl.h b/perl.h index 5d2d9b6..fb0f1e9 100644 --- a/perl.h +++ b/perl.h @@ -2977,8 +2977,8 @@ typedef pthread_key_t perl_key; # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) # else # if defined(_IOC_SIZE) && defined(__GLIBC__) - /* on Linux systems we're safe */ -# define IOCPARM_LEN(x) _IOC_SIZE(x) + /* on Linux systems we're safe; except when we're not [perl #38223] */ +# define IOCPARM_LEN(x) (_IOC_SIZE(x) < 256 ? 256 : _IOC_SIZE(x)) # else /* otherwise guess at what's safe */ # define IOCPARM_LEN(x) 256