summaryrefslogtreecommitdiff
path: root/tests/test_tile_decoder.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2016-09-21 21:15:25 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-09-21 21:15:25 +0200
commit8715ce2749d1e5a1e9c77646e9a2ddf0ec82bac9 (patch)
tree067560032024b39b93fdd5f2f4236383c958e385 /tests/test_tile_decoder.c
parent045aa4d9f297b8d3d5f89e9983a54252d103a3da (diff)
Fix some issues reported by Coverity Scan (#846)
* test_tile_decoder: Fix potential buffer overflow (coverity) CID 1190155 (#1 of 1): Unbounded source buffer (STRING_SIZE) Using a pointer instead of buffer of fixed size avoids the limit for the length of the input file name. Signed-off-by: Stefan Weil <sw@weilnetz.de> * test_tile_encoder: Fix potential buffer overflow (coverity) CID 1190154 (#1 of 1): Unbounded source buffer (STRING_SIZE) Using a pointer instead of buffer of fixed size avoids the limit for the length of the output file name. This implies that the length can exceed 255, so the data type for variable len had to be fixed, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> * openjpip: Initialize data before returning it This fixes an error reported by Coverity: CID 1190143 (#1 of 1): Uninitialized scalar variable (UNINIT) Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'tests/test_tile_decoder.c')
-rw-r--r--tests/test_tile_decoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c
index 26d3a16c..e5b851e8 100644
--- a/tests/test_tile_decoder.c
+++ b/tests/test_tile_decoder.c
@@ -178,7 +178,7 @@ int main (int argc, char *argv[])
int da_y0=0;
int da_x1=1000;
int da_y1=1000;
- char input_file[64];
+ const char *input_file;
/* should be test_tile_decoder 0 0 1000 1000 tte1.j2k */
if( argc == 6 )
@@ -187,7 +187,7 @@ int main (int argc, char *argv[])
da_y0=atoi(argv[2]);
da_x1=atoi(argv[3]);
da_y1=atoi(argv[4]);
- strcpy(input_file,argv[5]);
+ input_file = argv[5];
}
else
@@ -196,7 +196,7 @@ int main (int argc, char *argv[])
da_y0=0;
da_x1=1000;
da_y1=1000;
- strcpy(input_file,"test.j2k");
+ input_file = "test.j2k";
}
if (! l_data) {