Whamcloud - gitweb
LU-15099 kernel: kernel update RHEL7.9 [3.10.0-1160.45.1.el7]
[fs/lustre-release.git] / lustre / tests / create_foreign_dir.c
index 7cd9b77..a0601bf 100644 (file)
@@ -36,8 +36,10 @@ int main(int argc, char **argv)
                        }
                        break;
                case 'f':
+                       errno = 0;
                        flags = strtoul(optarg, &end, 0);
-                       if (*end != '\0') {
+                       if (errno != 0 || *end != '\0' ||
+                           flags >= UINT32_MAX) {
                                fprintf(stderr,
                                        "%s: invalid flags '%s'\n", argv[0],
                                        optarg);