]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
NFSv4 ACL parser: allow empty permission and flag fields
authorMartin Matuska <martin@matuska.org>
Sun, 12 Feb 2017 21:42:40 +0000 (22:42 +0100)
committerMartin Matuska <martin@matuska.org>
Sun, 12 Feb 2017 21:42:40 +0000 (22:42 +0100)
libarchive/archive_acl.c

index 00f66c1b5070ec96854335580673b2c6465e6b62..3ca970298752082cc33212b5b8f4fdc799416969 100644 (file)
@@ -1462,11 +1462,8 @@ ismode_w(const wchar_t *start, const wchar_t *end, int *permset)
 static int
 is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset)
 {
-       const wchar_t *p;
+       const wchar_t *p = start;
 
-       if (start >= end)
-               return (0);
-       p = start;
        while (p < end) {
                switch (*p++) {
                case L'r':
@@ -1528,11 +1525,8 @@ is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset)
 static int
 is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, int *permset)
 {
-       const wchar_t *p;
+       const wchar_t *p = start;
 
-       if (start >= end)
-               return (0);
-       p = start;
        while (p < end) {
                switch(*p++) {
                case L'f':
@@ -1940,11 +1934,8 @@ ismode(const char *start, const char *end, int *permset)
 static int
 is_nfs4_perms(const char *start, const char *end, int *permset)
 {
-       const char *p;
+       const char *p = start;
 
-       if (start >= end)
-               return (0);
-       p = start;
        while (p < end) {
                switch (*p++) {
                case 'r':
@@ -2006,11 +1997,8 @@ is_nfs4_perms(const char *start, const char *end, int *permset)
 static int
 is_nfs4_flags(const char *start, const char *end, int *permset)
 {
-       const char *p;
+       const char *p = start;
 
-       if (start >= end)
-               return (0);
-       p = start;
        while (p < end) {
                switch(*p++) {
                case 'f':