summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafayette.edu>2014-09-04 12:24:42 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2014-12-27 12:30:32 +0000
commit44abe250512cd33e228f25645e570b488957f776 (patch)
treee3a918e3bb0f79159776b3821e09f3be62d79f58 /ext
parente4701527082da3a0573bb7bd1f4ffdd8d8a29924 (diff)
downloadperl-44abe250512cd33e228f25645e570b488957f776.tar.gz
Correct usage of memEQs in attributes.xs [perl #122701]
Reported and diagnosed by Reini Urban <rurban@cpanel.net>. The call to memEQs(name, 6, "shared") could fail if name were shorter than 6 bytes, or if name were longer than 6, but started with "shared". (cherry picked from commit dd369969a58d736f281ffebe36fc24ab45b29fa6)
Diffstat (limited to 'ext')
-rw-r--r--ext/attributes/attributes.pm2
-rw-r--r--ext/attributes/attributes.xs2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/attributes/attributes.pm b/ext/attributes/attributes.pm
index 7c3c0b0247..ebca214608 100644
--- a/ext/attributes/attributes.pm
+++ b/ext/attributes/attributes.pm
@@ -1,6 +1,6 @@
package attributes;
-our $VERSION = 0.22;
+our $VERSION = 0.23;
@EXPORT_OK = qw(get reftype);
@EXPORT = ();
diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs
index dbb644d066..6b36812b13 100644
--- a/ext/attributes/attributes.xs
+++ b/ext/attributes/attributes.xs
@@ -97,7 +97,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs)
}
break;
default:
- if (memEQs(name, 6, "shared")) {
+ if (memEQs(name, len, "shared")) {
if (negated)
Perl_croak(aTHX_ "A variable may not be unshared");
SvSHARE(sv);