Просмотр исходного кода

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
Родитель
Сommit
ac65897081
1 измененных файлов с 1 добавлено и 1 удалено
  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");
   }