Made parse_size_arg()'s parsing a little stricter.
authorWayne Davison <wayned@samba.org>
Sat, 15 Oct 2005 06:53:04 +0000 (06:53 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 15 Oct 2005 06:53:04 +0000 (06:53 +0000)
options.c

index 198a903..a5b862f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -666,11 +666,10 @@ static OFF_T parse_size_arg(char **size_arg, char def_suf)
                mult = 1024;
        if ((p = strstr(arg, "+1")) != NULL
         || (p = strstr(arg, "-1")) != NULL) {
                mult = 1024;
        if ((p = strstr(arg, "+1")) != NULL
         || (p = strstr(arg, "-1")) != NULL) {
-               if (p[2] == '\0') {
-                       size = atoi(p + (*p == '+'));
-                       make_compatible = 1;
-               } else
-                       p = NULL;
+               if (p[2] != '\0')
+                       return -1;
+               size = atoi(p);
+               make_compatible = 1;
        }
        switch (*arg && arg != p ? *arg : def_suf) {
        case 'b': case 'B':
        }
        switch (*arg && arg != p ? *arg : def_suf) {
        case 'b': case 'B':