[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, lab-refactor, updated. 2.5.3-149-g7701496



The following commit has been merged in the lab-refactor branch:
commit 77014960263440b8c7a580ea8c44eeb897a09bd7
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Oct 27 15:27:54 2011 +0200

    Sanitize Manifest entries to avoid breaking the file format
    
    Since the manifest files are "one entry per line" and uses
    semi-colon as value separator, values should not contain either
    a newline or semi-colons.  The L::L::Manifest::set method will
    now map the newline character to whitespace and semicolon to
    underscore.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/lib/Lintian/Lab/Manifest.pm b/lib/Lintian/Lab/Manifest.pm
index 73f0a59..635a8d7 100644
--- a/lib/Lintian/Lab/Manifest.pm
+++ b/lib/Lintian/Lab/Manifest.pm
@@ -302,7 +302,13 @@ sub set {
     my (undef, $fields, $qf) = $self->_type_to_fields;
 
     # Copy the relevant fields - ensuring all fields are defined.
-    %pdata = map { $_ => $entry->{$_}//'' } @$fields;
+    foreach my $field (@$fields) {
+        my $val = $entry->{$field} // '';
+        # Avoid some problematic characters that would break the file
+        # format.
+        $val =~ tr/;\n/_ /;
+        $pdata{$field} = $val;
+    }
     $self->_do_set ($self->{'state'}, $qf, \%pdata);
     $self->_mark_dirty(1);
     return 1;

-- 
Debian package checker


Reply to: