parse: fix crash with empty FIO_OPT_STR_STORE variables
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 079f19e3d32754f53ebfb3d9ca0ff5a8c707fc15..83c59f7026ca7e06b5371d59adfb2b0bd2d39b35 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -608,6 +608,9 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
        case FIO_OPT_STR_STORE: {
                fio_opt_str_fn *fn = o->cb;
 
+               if (!strlen(ptr))
+                       return 1;
+
                if (o->off1) {
                        cp = td_var(data, o, o->off1);
                        *cp = strdup(ptr);