Fix svace issues in arastorage and testcases for that
authorAhreum Jeong <ahreum.jeong@samsung.com>
Wed, 30 Aug 2017 03:31:31 +0000 (12:31 +0900)
committerAhreum Jeong <ahreum.jeong@samsung.com>
Wed, 30 Aug 2017 04:46:49 +0000 (13:46 +0900)
commite6487a711685094041c0b50e7a0986616927fc1d
treea7fcc065bac60e6e0629359632f99a73d0b2b62a
parentb4e3fcbc4d2d3e18adce064d71cf3defded2d4a8
Fix svace issues in arastorage and testcases for that

utc_arastorage_main.c
- Use of vulnerable function 'sprintf' at utc_arastorage_main.c:165. This function is unsafe, use snprintf instead.
- After having been assigned to NULL value at utc_arastorage_main.c:851, pointer '0' is passed as 1st parameter in call to function 'cursor_move_last' at utc_arastorage_main.c:851, where it is dereferenced at cursor.c:80.
- After having been assigned to NULL value at utc_arastorage_main.c:773, pointer '0' is passed as 1st parameter in call to function 'cursor_move_next' at utc_arastorage_main.c:773, where it is dereferenced at cursor.c:86.
- After having been assigned to NULL value at utc_arastorage_main.c:812, pointer '0' is passed as 1st parameter in call to function 'cursor_move_prev' at utc_arastorage_main.c:812, where it is dereferenced at cursor.c:92.
- Expression '(count)' has type 'tuple_id_t' ('unsigned int'), so it's never less than zero

storage_interface.c
- Copying from string 'filename' to '&g_storage_write_buffer.file_name[0]' without null termination at storage_interface.c:557 by calling function 'memcpy'.
- Copying from parameter string 'name' to '&rel->name[0]' at storage_interface.c:184 may form a non-terminated C string of size 17.

aql_exec.c
- This statement in the source code might be unreachable during program execution.

index_bplustree.c
- Dynamic memory referenced by 'path' was allocated at index_bplustree.c:1376 by calling function 'malloc' and lost at index_bplustree.c:1391.
- The handle 'fd' was created at storage_abstraction.c:51 by calling function 'storage_open' at index_bplustree.c:522 and lost at index_bplustree.c:527.

relation.c
- Dynamic memory referenced by 'cursor' was allocated at relation.c:1064 by calling function 'malloc' and lost at relation.c:1102.
apps/examples/testcase/ta_tc/arastorage/utc/utc_arastorage_main.c
framework/src/arastorage/aql_exec.c
framework/src/arastorage/cursor.c
framework/src/arastorage/index_bplustree.c
framework/src/arastorage/relation.c
framework/src/arastorage/storage_interface.c