This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=153aa6b18b864c673cca2190dddf9f7705236f5c

commit 153aa6b18b864c673cca2190dddf9f7705236f5c
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Feb 22 02:36:24 2023 +0100

    libdpkg: Move parse_nv() next word check inside else block
    
    If we found a name/value match, and are using a fallback value, then we
    will always have a NULL str_end, and the check for trailing junk will
    never trigger. This check only makes sense in the else block where
    we have checked for any non-space characters after the parsed text.
---
 lib/dpkg/fields.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index 609d4c687..2210e3c23 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -86,10 +86,10 @@ parse_nv(struct parsedb_state *ps, enum parse_nv_mode 
parse_mode,
     while (c_isspace(str_end[0]))
       str_end++;
     value = nv->value;
-  }
 
-  if (parse_mode != PARSE_NV_NEXT && str_is_set(str_end))
-    return dpkg_put_error(&ps->err, _("has trailing junk"));
+    if (parse_mode != PARSE_NV_NEXT && str_is_set(str_end))
+      return dpkg_put_error(&ps->err, _("has trailing junk"));
+  }
 
   *strp = str_end;
 

-- 
Dpkg.Org's dpkg

Reply via email to