summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-11-13 14:46:04 +0000
committerNorbert Preining <preining@logic.at>2017-11-13 14:46:04 +0000
commit0a02e64a0bffda4a790855d51deab7d8df6e3937 (patch)
tree85fa797d8f93b0e6e8ac1373a45c0b1edb627ce2 /Master
parent30583788d2cdc36d25194cbb4014008d35efa409 (diff)
fix possible undefined behaviour in paper handling
git-svn-id: svn://tug.org/texlive/trunk@45774 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl6
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm1
2 files changed, 6 insertions, 1 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 4712f2deed4..9a1dc2bb0c2 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -1237,8 +1237,12 @@ sub action_paper {
} else { # program-specific paper
my $prog = $action; # first argument is the program to change
my $pkg = $TeXLive::TLPaper::paper{$prog}{'pkg'};
+ if (!$pkg) {
+ tlwarn("Unknown paper configuration program $prog!\n");
+ return ($F_ERROR);
+ }
if (!$localtlpdb->get_package($pkg)) {
- tlwarn("$prg: package $pkg is not installed - cannot adjust paper size!\n");
+ tlwarn("$prg: package $prog is not installed - cannot adjust paper size!\n");
return ($F_ERROR);
}
my $arg = shift @ARGV; # get "paper" argument
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 32015fa692d..b4e79bd8711 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -737,6 +737,7 @@ sub get_package {
sub _get_package {
my ($self,$pkg) = @_;
+ return undef if (!$pkg);
if (defined($self->{'tlps'}{$pkg})) {
my $ret = $self->{'tlps'}{$pkg};
return $self->{'tlps'}{$pkg};