The following commit has been merged in the master branch:
commit 66a76d5abbc8dce24296108d109a96e7affad7cc
Author: Raphaël Hertzog <[email protected]>
Date:   Wed Dec 21 09:59:39 2011 +0100

    Dpkg::Changelog::Entry::Debian: check_header() now validates the version

diff --git a/scripts/Dpkg/Changelog/Entry/Debian.pm 
b/scripts/Dpkg/Changelog/Entry/Debian.pm
index 3607c7a..d42b43c 100644
--- a/scripts/Dpkg/Changelog/Entry/Debian.pm
+++ b/scripts/Dpkg/Changelog/Entry/Debian.pm
@@ -114,7 +114,7 @@ sub check_header {
     my ($self) = @_;
     my @errors;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
-       my $options = $4;
+       my ($version, $options) = ($2, $4);
        $options =~ s/^\s+//;
        my %optdone;
        foreach my $opt (split(/\s*,\s*/, $options)) {
@@ -135,6 +135,10 @@ sub check_header {
                push @errors, sprintf(_g("unknown key-value %s"), $k);
            }
        }
+       my ($ok, $msg) = version_check($version);
+       unless ($ok) {
+           push @errors, sprintf(_g("version '%s' is invalid: %s"), $version, 
$msg);
+       }
     } else {
        push @errors, _g("the header doesn't match the expected regex");
     }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to