Przeglądaj źródła

libdpkg: Fix version_strict_check() to not allow '-' in revision

The revision cannot possibly have a '-' in it, so do not allow it. This
is innocuous in the current code as the parser makes sure the versions
are split on last '-', which implies the revision will never have one,
but it could happen that a manually constructed versionrevision could
contain one.
Guillem Jover 15 lat temu
rodzic
commit
ac65897081
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      lib/dpkg/parsehelp.c

+ 1 - 1
lib/dpkg/parsehelp.c

@@ -271,7 +271,7 @@ version_strict_check(struct versionrevision *rversion)
       return _("invalid character in version number");
   }
   for (ptr = rversion->revision; *ptr; ptr++) {
-    if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~", *ptr) == NULL)
+    if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".+~", *ptr) == NULL)
       return _("invalid character in revision number");
   }