projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67bf982
)
Fix a potential integer overflow
author
Jianpeng Ma
<majianpeng@gmail.com>
Thu, 10 Jan 2013 12:19:27 +0000
(13:19 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 10 Jan 2013 12:19:27 +0000
(13:19 +0100)
Because nr_files and new_size are not same types.It can cause new_size
less than zero.Then realloc will be failed.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c
patch
|
blob
|
blame
|
history
diff --git
a/filesetup.c
b/filesetup.c
index b1ca9217c1f30a1a7bb8eec6452f1c0ecb8c1316..69eb37cd70ea9192606cc6bd4226f09f68216621 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-1074,7
+1074,7
@@
int add_file(struct thread_data *td, const char *fname)
fio_file_reset(f);
if (td->files_size <= td->files_index) {
- int new_size = td->o.nr_files + 1;
+
unsigned
int new_size = td->o.nr_files + 1;
dprint(FD_FILE, "resize file array to %d files\n", new_size);