The following commit has been merged in the master branch:
commit 683d18a89197cfd824aaf291c008aebd9c6bd0c5
Author: Guillem Jover <guil...@debian.org>
Date:   Thu Dec 10 12:32:30 2009 +0100

    libdpkg: Properly increment seen fields in a stanza
    
    The current code was not incrementing the contents of the pointed area,
    but the pointer itself, which was making the check for already seen
    (duplicate) fields a no-op, and thus non-fatal, contrary to what was
    intended originally.
    
    This should not be a problem in general as the tools in charge of
    generating binary packages error out in case of duplicate fields, so
    there should not be many broken packages on the wild.
    
    This was spotted by a run with the clang static analyzer.

diff --git a/debian/changelog b/debian/changelog
index ab5d60b..096bcbd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,10 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     Closes: #560010
   * Do not allow diverting a file to itself, which makes the file to get
     removed. Closes: #312206
+  * Make the check for duplicate fields in a stanza in libdpkg actually work,
+    which now makes it fatal, as was intended originally. This should not
+    cause problems for anything using dpkg-dev to build packages as those
+    are already fatal on that case.
 
   [ Updated man page translations ]
   * French (Christian Perrier): correcting inconsistencies for the translation
diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c
index 80d0a48..d615147 100644
--- a/lib/dpkg/parse.c
+++ b/lib/dpkg/parse.c
@@ -218,7 +218,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
         value = m_realloc(value, valuelen + 1);
        memcpy(value,valuestart,valuelen);
         *(value + valuelen) = '\0';
-        if (*ip++)
+        if ((*ip)++)
           parse_error(&ps, &newpig,
                       _("duplicate value for `%s' field"), fip->name);
         fip->rcall(&newpig, newpifp, &ps, value, fip);

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to