Skip to content

Commit e7fb124

Browse files
committed
Fixed some invalid read errors due to reading 1 byte past the end of a buffer, and the other was accessing an element 1 past the end of an array.
1 parent e33d404 commit e7fb124

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/bulk_get.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ BOOST_AUTO_TEST_CASE( bulk_get ) {
7676
FILE* w_file;
7777
ds3_bulk_object current_obj = chunk_object_list->list[n];
7878
request = ds3_init_get_object_for_job(bucket_name, current_obj.name->value, current_obj.offset, bulk_response->job_id->value);
79-
tmp_files[file_index] = (char*) calloc(13, sizeof(char));
80-
memcpy(tmp_files[file_index], FILE_TEMPLATE, 12);
79+
tmp_files[file_index] = (char*) calloc(12, sizeof(char));
80+
memcpy(tmp_files[file_index], FILE_TEMPLATE, 11);
8181
w_file = fopen(tmp_files[file_index], "w+");
8282
error = ds3_get_object(client, request, w_file, ds3_write_to_file);
8383
ds3_free_request(request);
@@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE( bulk_get ) {
8686
}
8787
}
8888

89-
for (i = 0; i <= file_index;i++) {
89+
for (i = 0; i < file_index; i++) {
9090
unlink(tmp_files[i]);
9191
free(tmp_files[i]);
9292
}

0 commit comments

Comments
 (0)