From 0aec63d137e30cad121a03c81e412b62aa3446e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Fernando=20Mu=C3=B1oz=20Mej=C3=ADas?= Date: Mon, 21 Oct 2013 15:27:54 +0200 Subject: [PATCH] Validate the module name --- src/main/perl/ComponentProxyList.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/perl/ComponentProxyList.pm b/src/main/perl/ComponentProxyList.pm index 5639bf75..b11d7149 100644 --- a/src/main/perl/ComponentProxyList.pm +++ b/src/main/perl/ComponentProxyList.pm @@ -392,8 +392,6 @@ sub _sortComponents } - - # # _getComponents(): boolean # instantiates the list of components specified in new(). If @@ -422,6 +420,11 @@ sub _getComponents { if ($prop->getBooleanValue() eq 'true') { if ($cfg->elementExists("/software/components/$cname/ncm-module")) { $module = $cfg->getValue("/software/components/$cname/ncm-module"); + if ($module !~ m{^([a-z_]\w*(?:::)?)+}) { + $self->error("Invalid module $module for component $cname"); + return undef; + } + $module = $1; } push(@compnames,$module); }