summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Gettext.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-09-14 23:26:16 +0200
committerGuillem Jover <guillem@debian.org>2016-10-30 06:29:51 +0100
commit583e7b0ab992c4770414e1f8f903f207035d0523 (patch)
tree23d407b39c340e4ac227f95fa52b7012bfd5fa9c /scripts/Dpkg/Gettext.pm
parentb4e88220c2ba83bb96fc8f7430437b7d3e1bf1bf (diff)
downloaddpkg-583e7b0ab992c4770414e1f8f903f207035d0523.tar.gz
perl: Remove default «.» from @INC before loading modules
When loading eval'ed modules we should remove «.» from @INC, or we might end up loading code under the caller's control. Fixes: CVE-2016-1238
Diffstat (limited to 'scripts/Dpkg/Gettext.pm')
-rw-r--r--scripts/Dpkg/Gettext.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/Dpkg/Gettext.pm b/scripts/Dpkg/Gettext.pm
index 7be03d495..aa5aeb8da 100644
--- a/scripts/Dpkg/Gettext.pm
+++ b/scripts/Dpkg/Gettext.pm
@@ -98,7 +98,10 @@ or $msgid_plural otherwise.
use constant GETTEXT_CONTEXT_GLUE => "\004";
BEGIN {
- eval 'use Locale::gettext';
+ eval q{
+ pop @INC if $INC[-1] eq '.';
+ use Locale::gettext;
+ };
if ($@) {
eval q{
sub g_ {