Make `--max-alloc=0` safer.
[rsync.git] / options.c
index 93bbe7b06cc535deb7e38e7503c41df052bafdd8..fd674754cd5e4992b05050d69c092cf207979c91 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1946,6 +1946,8 @@ int parse_arguments(int *argc_p, const char ***argv_p)
                        goto cleanup;
                max_alloc = size;
        }
+       if (!max_alloc)
+               max_alloc = SIZE_MAX;
 
        if (old_style_args < 0) {
                if (!am_server && protect_args <= 0 && (arg = getenv("RSYNC_OLD_ARGS")) != NULL && *arg) {