The following commit has been merged in the sid branch:
commit d84b36a81088721b340e52664aa2c3379fea2a9a
Author: Guillem Jover <guil...@debian.org>
Date:   Wed May 4 09:41:37 2011 +0200

    libdpkg: Allow again unknown Priority field values
    
    The code was not properly advancing the end of the value string when
    reaching the fallback case (on values not known for the Priority field),
    and the validation for junk after the first word was failing on the
    actual first word.
    
    This change reverts to the previous behaviour of blindly accepting the
    whole value string for a field, regardless of it being multiword, when
    it's the fallback case.
    
    Regression introduced in commit b3f669039f128d715ac7ac71abaeac86f0954112.
    
    Analysis-by: Raphaƫl Hertzog <hert...@debian.org>
    Analysis-by: Guillem Jover <guil...@debian.org>

diff --git a/debian/changelog b/debian/changelog
index 5fe55fe..854972c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+dpkg (1.16.0.3) UNRELEASED; urgency=low
+
+  * Allow again Priority field values not known to dpkg. Regression
+    introduced in 1.16.0.
+
+ -- Guillem Jover <guil...@debian.org>  Wed, 04 May 2011 09:39:09 +0200
+
 dpkg (1.16.0.2) unstable; urgency=high
 
   * Fix dpkg-split --auto to not fail when opening the new depot file.
diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index 4376581..b56dc1e 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -48,9 +48,14 @@ parse_nv_next(struct parsedb_state *ps, const struct pkginfo 
*pigp,
   if (nv == NULL)
     parse_error(ps, pigp, _("'%.50s' is not allowed for %s"), str_start, what);
 
-  str_end = str_start + nv->length;
-  while (isspace(str_end[0]))
-    str_end++;
+  /* We got the fallback value, skip further string validation. */
+  if (nv->length == 0) {
+    str_end = NULL;
+  } else {
+    str_end = str_start + nv->length;
+    while (isspace(str_end[0]))
+      str_end++;
+  }
   *strp = str_end;
 
   return nv->value;
@@ -64,7 +69,7 @@ parse_nv_last(struct parsedb_state *ps, const struct pkginfo 
*pkg,
   int value;
 
   value = parse_nv_next(ps, pkg, what, nv_head, &str);
-  if (str[0] != '\0')
+  if (str != NULL && str[0] != '\0')
     parse_error(ps, pkg, _("junk after %s"), what);
 
   return value;

-- 
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