summaryrefslogtreecommitdiffstats
path: root/lib/Package/Stash/PP.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-09-05 19:54:11 -0500
committerJesse Luehrs <doy@tozt.net>2011-09-05 19:54:11 -0500
commit875d2d1d34aa0a6657891a86ed83e7e89966f237 (patch)
treefc1cc6d916f938b73796b416cc5b0d2a3d623202 /lib/Package/Stash/PP.pm
parented131e4112640c781865aad216cb3c424e5d2ab9 (diff)
downloadpackage-stash-875d2d1d34aa0a6657891a86ed83e7e89966f237.tar.gz
package-stash-875d2d1d34aa0a6657891a86ed83e7e89966f237.zip
don't allow invalid stash entry names
Diffstat (limited to 'lib/Package/Stash/PP.pm')
-rw-r--r--lib/Package/Stash/PP.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Package/Stash/PP.pm b/lib/Package/Stash/PP.pm
index b3e3a7d..408f3be 100644
--- a/lib/Package/Stash/PP.pm
+++ b/lib/Package/Stash/PP.pm
@@ -92,6 +92,12 @@ sub namespace {
(defined $variable && length $variable)
|| confess "You must pass a variable name";
+ # XXX in pure perl, this will access things in inner packages,
+ # in xs, this will segfault - probably look more into this at
+ # some point
+ ($variable !~ /::/)
+ || confess "Variable names may not contain ::";
+
my $sigil = substr($variable, 0, 1, '');
if (exists $SIGIL_MAP{$sigil}) {