LDRA Testbed ® Code Review Report

System : Dovecot-src-lib-sql






Overall Result: FAIL







Report Production Report Configuration Analysis phases
  • C/C++ LDRA Testbed Version: 8.3.0
  • Config. File: C:\Testbed\CCPP_830_Release\C\sate_creport.dat
  • Produced On: Mon Aug 09 2010 at 19:40:20
  • Penalty File: C:\Testbed\CCPP_830_Release\c\cpen.dat
  • Report Level: Summary Report
  • Procedures Reported: Fails Only
  • Programming Standards Model: SATE 2010 L1 Plus
  • Line Numbers refer to: Original Source File
  • Violation Details: Violations Only
  • Reporting Scope: Full analysis scope
  • Static: Yes
  • Complexity: Yes
  • Static Data Flow: Yes
  • Information Flow: Yes
  • Cross Reference: Yes



Contents

Overall Quality Summary
Report on Program Components

Overall Quality Summary



Totals for Violated Quality Standards


Number of Violations LDRA Code (M) Mandatory Standards CERT Code
81 77 S Macro replacement list needs parentheses. CERT PRE02-C
54 78 S Macro parameter not in brackets. CERT PRE01-C,PRE02-C
1 483 S free parameter is not heap item. CERT MEM34-C
14 484 S Attempt to use already freed object. CERT MEM31-C
1 5 D Procedure contains UR data flow anomalies. CERT EXP33-C
93 45 D Pointer not checked for null before use CERT EXP08-C,EXP34-C
1 57 D Global not initialised at declaration. CERT EXP33-C
4 69 D Procedure contains UR data flow anomalies. CERT EXP33-C
8 77 D Local structure returned in function result  


Number of Violations LDRA Code (C) Checking (Mandatory) Standards CERT Code
4 76 D Procedure not called in code analysed  


Number of Violations LDRA Code (O) Optional Standards CERT Code

No Optional Standards Violated

Number of Mandatory Standards checked 27
Number of Checking Standards checked 1
Number of Optional Standards checked 3
Total Standards checked 31






OVERALL RESULT: FAIL




Out of 100 program components, 64 (64.00 %) pass ( of which 0 conditionally pass ) and 36 fail ( of which 0 fail only because of insufficient comments )

Procedure Results

Quality Result   Procedure   Source File   Unique Violations   Failure Density  
          (Viols/R.Line %)  
FAIL Global Program
Pass buffer_get_data buffer.h analysed in driver-mysql.c 0 0
Pass buffer_get_used_size buffer.h analysed in driver-mysql.c 0 0
Pass array_create_from_buffer_i array.h analysed in driver-mysql.c 0 0
FAIL array_create_i array.h analysed in driver-mysql.c 2 - 17 -
Pass array_free_i array.h analysed in driver-mysql.c 0 0
Pass array_is_created_i array.h analysed in driver-mysql.c 0 0
Pass array_get_pool_i array.h analysed in driver-mysql.c 0 0
Pass array_clear_i array.h analysed in driver-mysql.c 0 0
Pass array_append_i array.h analysed in driver-mysql.c 0 0
Pass array_append_array_i array.h analysed in driver-mysql.c 0 0
Pass array_insert_i array.h analysed in driver-mysql.c 0 0
Pass array_delete_i array.h analysed in driver-mysql.c 0 0
Pass array_get_i array.h analysed in driver-mysql.c 0 0
Pass array_idx_i array.h analysed in driver-mysql.c 0 0
Pass array_get_modifiable_i array.h analysed in driver-mysql.c 0 0
Pass array_append_space_i array.h analysed in driver-mysql.c 0 0
Pass array_copy array.h analysed in driver-mysql.c 0 0
Pass array_count_i array.h analysed in driver-mysql.c 0 0
Pass module_get_context_id module-context.h analysed in driver-mysql.c 0 0
FAIL sqlpool_request_new driver-sqlpool.c 4 - 38 -
FAIL sqlpool_request_free driver-sqlpool.c 2 - 4 -
Pass sqlpool_request_abort driver-sqlpool.c 0 0
Pass driver_sqlpool_new_conn_trans driver-sqlpool.c 0 0
FAIL sqlpool_request_handle_transaction driver-sqlpool.c 2 - 14 -
FAIL sqlpool_request_send_next driver-sqlpool.c 2 - 7 -
Pass sqlpool_reconnect driver-sqlpool.c 0 0
Pass sqlpool_state_changed driver-sqlpool.c 0 0
FAIL sqlpool_find_host_with_least_connections driver-sqlpool.c 4 - 6 -
FAIL sqlpool_add_connection driver-sqlpool.c 4 - 16 -
FAIL sqlpool_find_available_connection driver-sqlpool.c 2 - 2 -
FAIL driver_sqlpool_get_connection driver-sqlpool.c 2 - 3 -
Pass driver_sqlpool_ et_sync_connection driver-sqlpool.c 0 0
FAIL driver_sqlpool_parse_hosts driver-sqlpool.c 6 - 13 -
FAIL driver_sqlpool_init driver-sqlpool.c 2 - 3 -
Pass driver_sqlpool_deinit driver-sqlpool.c 0 0
Pass driver_sqlpool_connect driver-sqlpool.c 0 0
Pass driver_sqlpool_disconnect driver-sqlpool.c 0 0
FAIL driver_sqlpool_escape_string driver-sqlpool.c 2 - 25 -
Pass driver_sqlpool_timeout driver-sqlpool.c 0 0
Pass driver_sqlpool_prepend_request driver-sqlpool.c 0 0
Pass driver_sqlpool_append_request driver-sqlpool.c 0 0
FAIL driver_sqlpool_query_callback driver-sqlpool.c 4 - 15 -
FAIL driver_sqlpool_query driver-sqlpool.c 4 - 21 -
FAIL driver_sqlpool_exec driver-sqlpool.c 2 - 20 -
FAIL driver_sqlpool_query_s driver-sqlpool.c 6 - 15 -
FAIL driver_sqlpool_transaction_begin driver-sqlpool.c 4 - 24 -
FAIL driver_sqlpool_transaction_free driver-sqlpool.c 2 - 3 -
Pass driver_sqlpool_commit_callback driver-sqlpool.c 0 0

Quality Result   Procedure   Source File   Unique Violations   Failure Density  
          (Viols/R.Line %)  
FAIL driver_sqlpool_transaction_commit driver-sqlpool.c 2 - 17 -
FAIL driver_sqlpool_transaction_commit_s driver-sqlpool.c 4 - 6 -
Pass driver_sqlpool_ ransaction_rollback driver-sqlpool.c 0 0
Pass driver_sqlpool_update driver-sqlpool.c 0 0
FAIL sql_drivers_init sql-api.c 2 - 80 -
FAIL sql_drivers_deinit sql-api.c 2 - 60 -
FAIL sql_driver_register sql-api.c 2 - 60 -
Pass sql_driver_unregister sql-api.c 0 0
FAIL sql_find_driver sql-api.c 2 - 5 -
FAIL sql_init sql-api.c 4 - 6 -
Pass sql_deinit sql-api.c 0 0
Pass sql_get_flags sql-api.c 0 0
Pass sql_connect sql-api.c 0 0
Pass sql_disconnect sql-api.c 0 0
Pass sql_escape_string sql-api.c 0 0
Pass sql_exec sql-api.c 0 0
Pass sql_query sql-api.c 0 0
Pass sql_query_s sql-api.c 0 0
Pass sql_result_ref sql-api.c 0 0
Pass sql_result_unref sql-api.c 0 0
Pass sql_field_def_find sql-api.c 0 0
FAIL sql_result_build_map sql-api.c 2 - 3 -
Pass sql_result_setup_fetch sql-api.c 0 0
FAIL sql_result_fetch sql-api.c 2 - 4 -
Pass sql_result_next_row sql-api.c 0 0
Pass sql_result_get_fields_count sql-api.c 0 0
Pass sql_result_get_field_name sql-api.c 0 0
Pass sql_result_find_field sql-api.c 0 0
Pass sql_result_get_field_value sql-api.c 0 0
Pass sql_result_get_ ield_value_binary sql-api.c 0 0
Pass sql_result_find_field_value sql-api.c 0 0
Pass sql_result_get_values sql-api.c 0 0
Pass sql_result_get_error sql-api.c 0 0
Pass sql_result_not_connected_free sql-api.c 0 0
Pass sql_result_not_ onnected_next_row sql-api.c 0 0
Pass sql_result_not_ onnected_get_error sql-api.c 0 0
Pass sql_transaction_begin sql-api.c 0 0
Pass sql_transaction_commit sql-api.c 0 0
Pass sql_transaction_commit_s sql-api.c 0 0
Pass sql_transaction_rollback sql-api.c 0 0
FAIL sql_update sql-api.c 2 - 20 -
Pass sql_update_get_rows sql-api.c 0 0
Pass sql_db_set_state sql-api.c 0 0
FAIL sql_transaction_add_query sql-api.c 2 - 5 -
FAIL sql_db_cache_db_deinit sql-db-cache.c 4 - 15 -
FAIL sql_db_cache_unlink sql-db-cache.c 2 - 5 -
FAIL sql_db_cache_free_tail sql-db-cache.c 2 - 27 -
Pass sql_db_cache_drop_oldest sql-db-cache.c 0 0
FAIL sql_db_cache_new sql-db-cache.c 7 - 18 -

Quality Result   Procedure   Source File   Unique Violations   Failure Density  
          (Viols/R.Line %)  
FAIL sql_db_cache_init sql-db-cache.c 6 - 57 -
FAIL sql_db_cache_deinit sql-db-cache.c 4 - 12 -


Global Information

Source Files in System

Name Last Modification Date
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\sql-db-cache.c Fri Jun 25 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\sql-api.c Tue May 04 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\driver-sqlpool.c Fri May 28 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\driver-sqlite.c Fri May 28 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\driver-pgsql.c Fri May 28 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib-sql\driver-mysql.c Fri May 28 19:00:04 2010




Global Basic Information

Number of procedures: 99
Number of locally uncalled procedures: 0
Maximum loop depth: 1
Total Cyclomatic Complexity: 184
Number of reformatted executable lines: 2438
Number of lines of comments: 4153



Summary Report on all Program Components which FAIL



Globals / code outside procedures - FAIL

Standards Violation Summary - All files

Code File: Src Line Violation Standard
M compat.h: 214 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 215 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 216 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 217 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 218 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 219 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 220 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 221 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 222 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 223 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 224 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 225 Macro replacement list needs parentheses. CERT PRE02-C
M compat.h: 226 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 196 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 197 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 204 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M macros.h: 204 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 205 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M macros.h: 205 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 223 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M macros.h: 223 Macro replacement list needs parentheses. CERT PRE02-C
M macros.h: 232 Macro replacement list needs parentheses. CERT PRE02-C
M data-stack.h: 49 Macro replacement list needs parentheses. CERT PRE02-C
M data-stack.h: 51 Macro replacement list needs parentheses. CERT PRE02-C
M data-stack.h: 75 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M data-stack.h: 85 Macro replacement list needs parentheses. CERT PRE02-C
M data-stack.h: 90 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M data-stack.h: 90 Macro replacement list needs parentheses. CERT PRE02-C
M data-stack.h: 97 Macro replacement list needs parentheses. CERT PRE02-C
M mempool.h: 84 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M mempool.h: 87 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M mempool.h: 88 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M mempool.h: 99 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M mempool.h: 99 Macro replacement list needs parentheses. CERT PRE02-C
M mempool.h: 102 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M mempool.h: 102 Macro replacement list needs parentheses. CERT PRE02-C
M imem.h: 8 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M imem.h: 8 Macro replacement list needs parentheses. CERT PRE02-C
M imem.h: 14 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M imem.h: 14 Macro replacement list needs parentheses. CERT PRE02-C
M imem.h: 15 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M imem.h: 15 Macro replacement list needs parentheses. CERT PRE02-C
M array-decl.h: 4 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array-decl.h: 4 Macro replacement list needs parentheses. CERT PRE02-C
M array-decl.h: 7 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array-decl.h: 7 Macro replacement list needs parentheses. CERT PRE02-C
M array-decl.h: 9 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array-decl.h: 9 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 35 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 35 Macro replacement list needs parentheses. CERT PRE02-C

Code File: Src Line Violation Standard
M array.h: 37 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 37 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 39 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 39 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 53 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 58 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 58 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 62 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 62 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 90 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 90 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 102 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 102 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 110 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 118 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 126 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 134 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 143 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 143 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 153 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 164 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 164 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 174 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 174 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 183 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 183 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 192 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 192 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 201 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 201 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 206 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 206 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 211 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 211 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 216 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 216 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 228 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 232 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 232 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 252 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 257 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 261 Macro replacement list needs parentheses. CERT PRE02-C
M array.h: 266 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 279 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M array.h: 279 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 27 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-api.h: 27 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 32 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-api.h: 32 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 34 Macro parameter not in brackets. CERT PRE01-C,PRE02-C

Code File: Src Line Violation Standard
M sql-api.h: 34 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 36 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-api.h: 36 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 38 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-api.h: 38 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.h: 82 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-api.h: 135 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 45 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 48 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 62 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 62 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 66 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 70 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 70 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 89 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 89 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 98 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 98 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 100 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M module-context.h: 100 Macro replacement list needs parentheses. CERT PRE02-C
M module-context.h: 103 Macro replacement list needs parentheses. CERT PRE02-C
M ioloop.h: 50 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M ioloop.h: 50 Macro replacement list needs parentheses. CERT PRE02-C
M ioloop.h: 56 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M ioloop.h: 75 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M ioloop.h: 75 Macro replacement list needs parentheses. CERT PRE02-C
M llist.h: 5 Macro replacement list needs parentheses. CERT PRE02-C
M llist.h: 12 Macro replacement list needs parentheses. CERT PRE02-C
M llist.h: 25 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M llist.h: 25 Macro replacement list needs parentheses. CERT PRE02-C
M llist.h: 32 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M llist.h: 32 Macro replacement list needs parentheses. CERT PRE02-C
M llist.h: 39 Macro replacement list needs parentheses. CERT PRE02-C
M sql-api.c: 12 Global not initialised at declaration. : sql_drivers CERT EXP33-C
M sql-db-cache.c: 9 Macro parameter not in brackets. CERT PRE01-C,PRE02-C
M sql-db-cache.c: 9 Macro replacement list needs parentheses. CERT PRE02-C

[ Top of Report | Procedure Table | Contents ]







array_create_i
(93 to 101 array.h analysed in driver-mysql.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 100 Pointer not checked for null before use : buffer CERT EXP08-C,EXP34-C
  99    


[ Top of Report | Procedure Table | Contents ]







sqlpool_request_new
(82 to 92 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 91 Local structure returned in function result : request  
M 88 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  87    
M 87 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 509)    


[ Top of Report | Procedure Table | Contents ]







sqlpool_request_free
(94 to 104 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 103 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  102    


[ Top of Report | Procedure Table | Contents ]







sqlpool_request_handle_transaction
(134 to 148 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 145 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 145 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 145 Pointer not checked for null before use : trans CERT EXP08-C,EXP34-C
  145    
M 145 Pointer not checked for null before use : trans CERT EXP08-C,EXP34-C
  145    
M 145 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  140    
M 145 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  145    


[ Top of Report | Procedure Table | Contents ]







sqlpool_request_send_next
(150 to 170 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 163 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  163    
M 163 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  163    
M 159 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  158    
M 163 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 163 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 163 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  163    


[ Top of Report | Procedure Table | Contents ]







sqlpool_find_host_with_least_connections
(211 to 231 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 230 Local structure returned in function result : min  
M 221 Pointer not checked for null before use : hosts CERT EXP08-C,EXP34-C
  218    


[ Top of Report | Procedure Table | Contents ]







sqlpool_add_connection
(233 to 256 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 255 Local structure returned in function result : conn  
M 241 Pointer not checked for null before use : host CERT EXP08-C,EXP34-C
  240    
M 246 Pointer not checked for null before use : conndb CERT EXP08-C,EXP34-C
  245    
M 253 Pointer not checked for null before use : conn CERT EXP08-C,EXP34-C
  252    


[ Top of Report | Procedure Table | Contents ]







sqlpool_find_available_connection
(258 to 289 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 271 Pointer not checked for null before use : conns CERT EXP08-C,EXP34-C
  268    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_get_connection
(291 to 328 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 312 Pointer not checked for null before use : conns CERT EXP08-C,EXP34-C
  310    
M 326 Pointer not checked for null before use : conn CERT EXP08-C,EXP34-C
  317    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_parse_hosts
(352 to 410 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Violation Standard
M Procedure contains UR data flow anomalies. CERT EXP33-C

Code Line Violation Standard
M 395 Pointer not checked for null before use : host CERT EXP08-C,EXP34-C
  394    
M 402 Pointer not checked for null before use : host CERT EXP08-C,EXP34-C
  401    
M 395 Pointer not checked for null before use : connect_string CERT EXP08-C,EXP34-C
  390    
M 402 Pointer not checked for null before use : connect_string CERT EXP08-C,EXP34-C
  398    
M 366 Pointer not checked for null before use : args CERT EXP08-C,EXP34-C
  365    
M 376 Pointer not checked for null before use : key CERT EXP08-C,EXP34-C
  372    
M 377 Pointer not checked for null before use : value CERT EXP08-C,EXP34-C
  373    
M 382 Pointer not checked for null before use : (arr)->buffer CERT EXP08-C,EXP34-C
  360    
M 382 Pointer not checked for null before use : (arr)->element_size CERT EXP08-C,EXP34-C
  360    
M 357 Procedure contains UR data flow anomalies. : connect_args.arr.buffer CERT EXP33-C
  389    
M 357 Procedure contains UR data flow anomalies. : connect_args.arr.element_size CERT EXP33-C
  389    
M 398 Procedure contains UR data flow anomalies. : connect_string CERT EXP33-C
M 357 Procedure contains UR data flow anomalies. : hostnames.v CERT EXP33-C
  400    


Possible UR Anomalies

The following variables may be referenced before being given a value

File Undefine File Reference Variable
driver-sqlpool.c 357 driver-sqlpool.c 389 connect_args.arr.buffer
driver-sqlpool.c 357 driver-sqlpool.c 389 connect_args.arr.element_size
driver-sqlpool.c 398 driver-sqlpool.c 402 connect_string
driver-sqlpool.c 357 driver-sqlpool.c 400 hostnames.v

[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_init
(412 to 433 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 420 Pointer not checked for null before use : db CERT EXP08-C,EXP34-C
  419    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_escape_string
(488 to 497 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 496 Pointer not checked for null before use : conn CERT EXP08-C,EXP34-C
  495    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_query_callback
(542 to 574 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 551 Attempt to use already freed object. CERT MEM31-C
M 554 Attempt to use already freed object. CERT MEM31-C
M 559 Attempt to use already freed object. CERT MEM31-C
M 563 Attempt to use already freed object. CERT MEM31-C
M 572 Attempt to use already freed object. CERT MEM31-C
M 559 Pointer not checked for null before use : db.request_to CERT EXP08-C,EXP34-C
  554    
M 572 Pointer not checked for null before use : conndb CERT EXP08-C,EXP34-C
  566    
M 572 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  570    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_query
(576 to 594 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 583 Attempt to use already freed object. CERT MEM31-C
M 587 Attempt to use already freed object. CERT MEM31-C
M 588 Attempt to use already freed object. CERT MEM31-C
M 591 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  591    
M 591 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  591    
M 591 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  591    
M 584 Pointer not checked for null before use : request CERT EXP08-C,EXP34-C
  583    
M 591 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 591 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_exec
(596 to 599 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 598 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_query_s
(601 to 622 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 608 Attempt to use already freed object. CERT MEM31-C
M 615 Attempt to use already freed object. CERT MEM31-C
M 616 Local structure returned in function result : result  
M 621 Local structure returned in function result : result  
M 614 Pointer not checked for null before use : result CERT EXP08-C,EXP34-C
  613    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_transaction_begin
(624 to 645 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 634 Attempt to use already freed object. CERT MEM31-C
M 638 Attempt to use already freed object. CERT MEM31-C
M 642 Attempt to use already freed object. CERT MEM31-C
M 632 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  631    
M 638 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 631 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 509)    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_transaction_free
(647 to 657 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 656 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  653    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_transaction_commit
(667 to 682 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 679 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 679 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C
M 679 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  679    
M 679 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  679    
M 679 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  679    


[ Top of Report | Procedure Table | Contents ]







driver_sqlpool_transaction_commit_s
(684 to 710 driver-sqlpool.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 697 Attempt to use already freed object. CERT MEM31-C
M 708 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  704    


[ Top of Report | Procedure Table | Contents ]







sql_drivers_init
(14 to 17 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 16 Pointer not checked for null before use : sql_drivers.v_modifiable CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 16 Pointer not checked for null before use : sql_drivers.v CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 16 Pointer not checked for null before use : sql_drivers.arr.buffer CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 16 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 510)    


[ Top of Report | Procedure Table | Contents ]







sql_drivers_deinit
(19 to 22 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 21 Pointer not checked for null before use : sql_drivers.v_modifiable CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 21 Pointer not checked for null before use : sql_drivers.v CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 21 Pointer not checked for null before use : sql_drivers.arr.buffer CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    


[ Top of Report | Procedure Table | Contents ]







sql_driver_register
(24 to 27 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 26 Pointer not checked for null before use : sql_drivers.v_modifiable CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 26 Pointer not checked for null before use : sql_drivers.v CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    
M 26 Pointer not checked for null before use : sql_drivers.arr.buffer CERT EXP08-C,EXP34-C
  104 (sql-api-private.h)    


[ Top of Report | Procedure Table | Contents ]







sql_find_driver
(43 to 54 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 50 Pointer not checked for null before use : drivers CERT EXP08-C,EXP34-C
  48    


[ Top of Report | Procedure Table | Contents ]







sql_init
(56 to 73 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 72 Local structure returned in function result : db  
M 71 Pointer not checked for null before use : db CERT EXP08-C,EXP34-C
  70    


[ Top of Report | Procedure Table | Contents ]







sql_result_build_map
(169 to 206 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 183 Pointer not checked for null before use : name CERT EXP08-C,EXP34-C
  182    
M 180 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 510)    


[ Top of Report | Procedure Table | Contents ]







sql_result_fetch
(218 to 258 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 236 Pointer not checked for null before use : value CERT EXP08-C,EXP34-C
  230    
M 241 Pointer not checked for null before use : ptr CERT EXP08-C,EXP34-C
  231    
M 247 Pointer not checked for null before use : ptr CERT EXP08-C,EXP34-C
  231    


[ Top of Report | Procedure Table | Contents ]







sql_update
(366 to 369 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 368 Pointer not checked for null before use : NULL CERT EXP08-C,EXP34-C


[ Top of Report | Procedure Table | Contents ]







sql_transaction_add_query
(391 to 406 sql-api.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 397 Pointer not checked for null before use : tquery CERT EXP08-C,EXP34-C
  396    


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_db_deinit
(30 to 47 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 35 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  32    
M 43 Pointer not checked for null before use : head_ctx CERT EXP08-C,EXP34-C
  42    
M 32 Pointer not checked for null before use : sql_db_cache_module.id.module_id_register CERT EXP08-C,EXP34-C
  28    
M 42 Pointer not checked for null before use : sql_db_cache_module.id.module_id_register CERT EXP08-C,EXP34-C
  32    
C 30 Procedure not called in code analysed : sql_db_cache_db_deinit  


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_unlink
(49 to 68 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 59 Pointer not checked for null before use : prev_ctx CERT EXP08-C,EXP34-C
  58    
M 65 Pointer not checked for null before use : next_ctx CERT EXP08-C,EXP34-C
  64    


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_free_tail
(70 to 81 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 76 Pointer not checked for null before use : db CERT EXP08-C,EXP34-C
  75    
M 77 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  76    
M 76 Pointer not checked for null before use : sql_db_cache_module.id.module_id_register CERT EXP08-C,EXP34-C
  28    
M 79 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 511)    


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_new
(89 to 123 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 105 free parameter is not heap item. CERT MEM34-C
M 122 Local structure returned in function result : db  
M 98 Pointer not checked for null before use : key CERT EXP08-C,EXP34-C
  97    
M 101 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  100    
M 109 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  107    
M 110 Pointer not checked for null before use : ctx CERT EXP08-C,EXP34-C
  109    
M 114 Pointer not checked for null before use : db CERT EXP08-C,EXP34-C
  113    
M 117 Pointer not checked for null before use : _module_tmp CERT EXP08-C,EXP34-C
  117    
C 89 Procedure not called in code analysed : sql_db_cache_new  


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_init
(125 to 134 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 133 Local structure returned in function result : cache  
M 130 Pointer not checked for null before use : cache CERT EXP08-C,EXP34-C
  129    
M 130 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  Ref. Line -1101 (Module 511)    
C 125 Procedure not called in code analysed : sql_db_cache_init  


[ Top of Report | Procedure Table | Contents ]







sql_db_cache_deinit
(136 to 145 sql-db-cache.c) - FAIL

Standards Violation Summary

Code Line Violation Standard
M 144 Pointer not checked for null before use : default_pool CERT EXP08-C,EXP34-C
  142    
C 136 Procedure not called in code analysed : sql_db_cache_deinit  


[ Top of Report | Procedure Table | Contents ]



End of Code Review Report

Copyright © 2010 Liverpool Data Research Associates