summaryrefslogtreecommitdiff
path: root/verify.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-11-11 20:51:37 -0700
committerJens Axboe <axboe@fb.com>2014-11-11 20:51:37 -0700
commite499aedc141da35cf778116d0abcb9cfcd53470c (patch)
tree33b82862b6dceb9545d2e9ab5d0c2e422c550686 /verify.h
parent9e31134635165bc4c64c18da5d9e8bb44987978d (diff)
downloadfio-e499aedc141da35cf778116d0abcb9cfcd53470c.tar.gz
fio-e499aedc141da35cf778116d0abcb9cfcd53470c.tar.bz2
verify: verify_state_gen_name() should check size
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'verify.h')
-rw-r--r--verify.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/verify.h b/verify.h
index 3e52f9c1..43de887d 100644
--- a/verify.h
+++ b/verify.h
@@ -138,10 +138,12 @@ static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
return (void *) s + thread_io_list_sz(s);
}
-static inline void verify_state_gen_name(char *out, const char *name,
- const char *prefix, int num)
+static inline void verify_state_gen_name(char *out, size_t size,
+ const char *name, const char *prefix,
+ int num)
{
- sprintf(out, "%s-%s-%d-verify.state", prefix, name, num);
+ snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
+ out[size - 1] = '\0';
}
#endif