LDRA Testbed Code Review Report

LDRA Testbed ® Code Review Report

# System : Dovecot-src-util

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 22:06:31 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

- Totals of Violations for each Standard
- Table of Procedure Results
- Table of Source Files in System
- Table of Global Basic Information

Report on Program Components

- Quality Results Global Program and Selected Procedures

## Overall Quality Summary

#### Totals for Violated Quality Standards

Number of Violations | LDRA Code | (M) Mandatory Standards | CERT Code
--- | --- | --- | ---
4 | 47 S | Array Bound exceeded. | CERT ARR30-C
70 | 77 S | Macro replacement list needs parentheses. | CERT PRE02-C
49 | 78 S | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
2 | 486 S | Insufficient formats in output function. | CERT FIO00-C
10 | 5 D | Procedure contains UR data flow anomalies. | CERT EXP33-C
35 | 45 D | Pointer not checked for null before use | CERT EXP08-C,EXP34-C
5 | 57 D | Global not initialised at declaration. | CERT EXP33-C
19 | 69 D | Procedure contains UR data flow anomalies. | CERT EXP33-C
2 | 77 D | Local structure returned in function result |
5 | 86 D | User input not checked before use. | CERT FIO30-C

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

Number of Violations | LDRA Code | (O) Optional Standards | CERT Code
--- | --- | --- | ---
1 | 588 S | Use of system function. | CERT ENV04-C

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 53 program components, 27 (50.94 %) pass ( of which 0 conditionally pass ) and 26 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 |
FAIL |  | main |  | gdbhelper.c |  | 9 | - |  | 7 | - |
Pass |  | mail_index_offset_to_uint32 |  | listview.c |  | 0 |  | 0 |
FAIL |  | dump_hdr |  | listview.c |  | 2 | - |  | 5 | - |
FAIL |  | dump_dir |  | listview.c |  | 7 | - |  | 4 | - |
Pass |  | main |  | listview.c |  | 0 |  | 0 |
FAIL |  | sig_die |  | maildirlock.c |  | 2 | - |  | 33 | - |
FAIL |  | maildir_lock |  | maildirlock.c |  | 2 | - |  | 13 | - |
FAIL |  | main |  | maildirlock.c |  | 6 | - |  | 3 | - |
Pass |  | rawlog_proxy_destroy |  | rawlog.c |  | 0 |  | 0 |
FAIL |  | write_with_timestamps |  | rawlog.c |  | 2 | - |  | 13 | - |
Pass |  | proxy_write_data |  | rawlog.c |  | 0 |  | 0 |
Pass |  | proxy_write_in |  | rawlog.c |  | 0 |  | 0 |
Pass |  | proxy_write_out |  | rawlog.c |  | 0 |  | 0 |
FAIL |  | server_input |  | rawlog.c |  | 6 | - |  | 9 | - |
FAIL |  | client_input |  | rawlog.c |  | 6 | - |  | 9 | - |
FAIL |  | server_output |  | rawlog.c |  | 2 | - |  | 4 | - |
FAIL |  | client_output |  | rawlog.c |  | 2 | - |  | 4 | - |
FAIL |  | proxy_open_logs |  | rawlog.c |  | 2 | - |  | 4 | - |
FAIL |  | rawlog_proxy_create |  | rawlog.c |  | 4 | - |  | 7 | - |
FAIL |  | rawlog_open |  | rawlog.c |  | 6 | - |  | 5 | - |
FAIL |  | main |  | rawlog.c |  | 2 | - |  | 2 | - |
FAIL |  | client_connected |  | script-login.c |  | 11 | - |  | 8 | - |
FAIL |  | script_execute_finish |  | script-login.c |  | 2 | - |  | 3 | - |
Pass |  | main |  | script-login.c |  | 0 |  | 0 |
Pass |  | buffer_get_data |  | buffer.h analysed in script.c |  | 0 |  | 0 |
Pass |  | buffer_get_used_size |  | buffer.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_create_from_buffer_i |  | array.h analysed in script.c |  | 0 |  | 0 |
FAIL |  | array_create_i |  | array.h analysed in script.c |  | 2 | - |  | 17 | - |
Pass |  | array_free_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_is_created_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_get_pool_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_clear_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_append_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_append_array_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_insert_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_delete_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_get_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_idx_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_get_modifiable_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_append_space_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_copy |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | array_count_i |  | array.h analysed in script.c |  | 0 |  | 0 |
Pass |  | script_verify_version |  | script.c |  | 0 |  | 0 |
FAIL |  | client_connected |  | script.c |  | 6 | - |  | 5 | - |
FAIL |  | main |  | script.c |  | 4 | - |  | 7 | - |
FAIL |  | tcpwrap_client_handle |  | tcpwrap.c |  | 4 | - |  | 13 | - |
FAIL |  | tcpwrap_client_input |  | tcpwrap.c |  | 7 | - |  | 8 | - |
FAIL |  | tcpwrap_client_timeout |  | tcpwrap.c |  | 2 | - |  | 20 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | tcpwrap_client_create |  | tcpwrap.c |  | 4 | - |  | 20 | - |
Pass |  | tcpwrap_client_destroy |  | tcpwrap.c |  | 0 |  | 0 |
FAIL |  | client_connected |  | tcpwrap.c |  | 2 | - |  | 7 | - |
Pass |  | main |  | tcpwrap.c |  | 0 |  | 0 |

#### Global Information

#### Source Files in System

Name | Last Modification Date
--- | ---
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\tcpwrap.c | Thu May 27 19:00:08 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\tcpwrap-settings.c | Fri Jun 25 08:22:16 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\script.c | Fri Jun 04 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\script-login.c | Fri Jun 04 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\rawlog.c | Fri Jun 04 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\maildirlock.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\listview.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\util\gdbhelper.c | Mon Apr 05 19:00:04 2010

#### Global Basic Information

Number of procedures: | 52
Number of locally uncalled procedures: | 0
Maximum loop depth: | 1
Total Cyclomatic Complexity: | 183
Number of reformatted executable lines: | 1816
Number of lines of comments: | 5920

## 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 | mailbox-list-index-private.h: 80 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | mailbox-list-index-private.h: 82 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | listview.c: 11 | Global not initialised at declaration. : hdr | CERT EXP33-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 | mail-error.h: 19 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | mail-error.h: 19 | Macro replacement list needs parentheses. | CERT PRE02-C
M | mail-storage.h: 414 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | maildirlock.c: 20 | Global not initialised at declaration. : ioloop | CERT EXP33-C
M | istream.h: 53 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | istream.h: 53 | Macro replacement list needs parentheses. | CERT PRE02-C
M | ostream.h: 61 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | ostream.h: 61 | Macro replacement list needs parentheses. | CERT PRE02-C
M | rawlog.c: 23 | Global not initialised at declaration. : ioloop | CERT EXP33-C
M | settings-parser.h: 46 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | settings-parser.h: 46 | Macro replacement list needs parentheses. | CERT PRE02-C
M | settings-parser.h: 50 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | settings-parser.h: 50 | Macro replacement list needs parentheses. | CERT PRE02-C
M | settings-parser.h: 54 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | settings-parser.h: 54 | Macro replacement list needs parentheses. | CERT PRE02-C
M | settings-parser.h: 58 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | settings-parser.h: 58 | Macro replacement list needs parentheses. | CERT PRE02-C
M | settings-parser.h: 62 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
M | settings-parser.h: 62 | Macro replacement list needs parentheses. | CERT PRE02-C
M | script-login.c: 24 | Global not initialised at declaration. : exec_args | CERT EXP33-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
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

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
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 | script.c: 17 | Global not initialised at declaration. : exec_args | CERT EXP33-C
M | imem.h: 6 | Procedure contains UR data flow anomalies. : default_pool | CERT EXP33-C
| 116 (script.c) |  |
M | script.c: 17 | Procedure contains UR data flow anomalies. : exec_args.arr.buffer | CERT EXP33-C
| 116 |  |
M | script.c: 17 | Procedure contains UR data flow anomalies. : exec_args.arr.element_size | CERT EXP33-C
| 116 |  |
M | script.c: 17 | Procedure contains UR data flow anomalies. : exec_args.v | CERT EXP33-C
| 116 |  |
M | script.c: 17 | Procedure contains UR data flow anomalies. : exec_args.v_modifiable | CERT EXP33-C
| 116 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

main (12 to 72 gdbhelper.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 46 | Pointer not checked for null before use : cmd | CERT EXP08-C,EXP34-C
| 45 |  |
M | 58 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 55 |  |
M | 63 | User input not checked before use. : buf | CERT FIO30-C
| 62 |  |
M | 16 | Procedure contains UR data flow anomalies. : fd_in | CERT EXP33-C
| 29 |  |
M | 16 | Procedure contains UR data flow anomalies. : fd_out | CERT EXP33-C
| 29 |  |
M | 16 | Procedure contains UR data flow anomalies. : status | CERT EXP33-C
| 49 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
gdbhelper.c | 16 | gdbhelper.c | 29 | fd_in
gdbhelper.c | 16 | gdbhelper.c | 29 | fd_out
gdbhelper.c | 16 | gdbhelper.c | 49 | status

[ | Top of Report | | | Procedure Table | | | Contents | ]

dump_hdr (26 to 43 listview.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 36 | User input not checked before use. : hdr | CERT FIO30-C
| 30 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

dump_dir (45 to 126 listview.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 66 | Insufficient formats in output function. | CERT FIO00-C
M | 92 | Insufficient formats in output function. | CERT FIO00-C
M | 65 | User input not checked before use. : dir | CERT FIO30-C
| 55 |  |
M | 86 | User input not checked before use. : rec | CERT FIO30-C
| 78 |  |
M | 50 | Procedure contains UR data flow anomalies. : name | CERT EXP33-C
| 88 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
listview.c | 50 | listview.c | 88 | name

[ | Top of Report | | | Procedure Table | | | Contents | ]

sig_die (22 to 25 maildirlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
C | 22 | Procedure not called in code analysed : sig_die |

[ | Top of Report | | | Procedure Table | | | Contents | ]

maildir_lock (27 to 36 maildirlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 35 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 34 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

main (38 to 105 maildirlock.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Pointer not checked for null before use : dotlock_settings.temp_prefix | CERT EXP08-C,EXP34-C
| 15 |  |
M | 43 | Procedure contains UR data flow anomalies. : fd | CERT EXP33-C
| 51 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
maildirlock.c | 43 | maildirlock.c | 51 | fd

[ | Top of Report | | | Procedure Table | | | Contents | ]

write_with_timestamps (71 to 96 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 85 | Pointer not checked for null before use : timestamp | CERT EXP08-C,EXP34-C
| 78 |  |
M | 90 | Pointer not checked for null before use : timestamp | CERT EXP08-C,EXP34-C
| 78 |  |
M | 85 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 81 |  |
M | 93 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 81 |  |
M | 88 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 81 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

server_input (148 to 167 rawlog.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 150 | Procedure contains UR data flow anomalies. : buf | CERT EXP33-C
| 161 |  |
C | 148 | Procedure not called in code analysed : server_input |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
rawlog.c | 150 | rawlog.c | 161 | buf

[ | Top of Report | | | Procedure Table | | | Contents | ]

client_input (169 to 188 rawlog.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 171 | Procedure contains UR data flow anomalies. : buf | CERT EXP33-C
| 182 |  |
C | 169 | Procedure not called in code analysed : client_input |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
rawlog.c | 171 | rawlog.c | 182 | buf

[ | Top of Report | | | Procedure Table | | | Contents | ]

server_output (190 to 206 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
C | 190 | Procedure not called in code analysed : server_output |

[ | Top of Report | | | Procedure Table | | | Contents | ]

client_output (208 to 224 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
C | 208 | Procedure not called in code analysed : client_output |

[ | Top of Report | | | Procedure Table | | | Contents | ]

proxy_open_logs (226 to 259 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 241 | Pointer not checked for null before use : fname | CERT EXP08-C,EXP34-C
| 239 |  |
M | 251 | Pointer not checked for null before use : fname | CERT EXP08-C,EXP34-C
| 249 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

rawlog_proxy_create (261 to 290 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 289 | Local structure returned in function result : proxy |
M | 268 | Pointer not checked for null before use : proxy | CERT EXP08-C,EXP34-C
| 267 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

rawlog_open (292 to 359 rawlog.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 308 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 307 |  |
M | 302 | Pointer not checked for null before use : home | CERT EXP08-C,EXP34-C
| 300 |  |
M | 307 | Pointer not checked for null before use : home | CERT EXP08-C,EXP34-C
| 302 |  |
M | 353 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 323 |  |
M | 296 | Procedure contains UR data flow anomalies. : sfd | CERT EXP33-C
| 326 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
rawlog.c | 296 | rawlog.c | 326 | sfd

[ | Top of Report | | | Procedure Table | | | Contents | ]

main (361 to 410 rawlog.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 404 | Pointer not checked for null before use : executable | CERT EXP08-C,EXP34-C
| 398 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

client_connected (27 to 144 script-login.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 48 | Array Bound exceeded. | CERT ARR30-C
M | 58 | Pointer not checked for null before use : version_line | CERT EXP08-C,EXP34-C
| 57 |  |
M | 87 | Pointer not checked for null before use : args | CERT EXP08-C,EXP34-C
| 85 |  |
M | 101 | Pointer not checked for null before use : input.username | CERT EXP08-C,EXP34-C
| 96 |  |
M | 104 | Pointer not checked for null before use : args | CERT EXP08-C,EXP34-C
| 104 |  |
M | 108 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 107 |  |
M | 112 | Pointer not checked for null before use : keys | CERT EXP08-C,EXP34-C
| 84 |  |
M | 47 | Pointer not checked for null before use : instr | CERT EXP08-C,EXP34-C
| 44 |  |
M | 85 | Pointer not checked for null before use : data_line | CERT EXP08-C,EXP34-C
| 60 |  |
M | 47 | User input not checked before use. : buf | CERT FIO30-C
| 54 |  |
M | 36 | Procedure contains UR data flow anomalies. : buf | CERT EXP33-C
| 45 |  |
M | 32 | Procedure contains UR data flow anomalies. : error | CERT EXP33-C
| 118 |  |
M | 35 | Procedure contains UR data flow anomalies. : user | CERT EXP33-C
| 118 |  |
M | 62 | Procedure contains UR data flow anomalies. : version_line | CERT EXP33-C
| 32 |  |
C | 27 | Procedure not called in code analysed : client_connected |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
script-login.c | 36 | script-login.c | 45 | buf
script-login.c | 32 | script-login.c | 118 | error
script-login.c | 35 | script-login.c | 118 | user
script-login.c | 35 | script-login.c | 120 | user
script-login.c | 62 | script-login.c | 64 | version_line

[ | Top of Report | | | Procedure Table | | | Contents | ]

script_execute_finish (146 to 178 script-login.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 161 | Pointer not checked for null before use : keys | CERT EXP08-C,EXP34-C
| 161 |  |
M | 159 | Pointer not checked for null before use : reply | CERT EXP08-C,EXP34-C
| 149 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

array_create_i (93 to 101 array.h analysed in script.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 | ]

client_connected (28 to 91 script.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 65 | Array Bound exceeded. | CERT ARR30-C
M | 65 | Array Bound exceeded. | CERT ARR30-C
M | 90 | Pointer not checked for null before use : args | CERT EXP08-C,EXP34-C
| 89 |  |
M | 73 | Pointer not checked for null before use : args | CERT EXP08-C,EXP34-C
| 73 |  |
M | 50 | Pointer not checked for null before use : input | CERT EXP08-C,EXP34-C
| 39 |  |
C | 28 | Procedure not called in code analysed : client_connected |

[ | Top of Report | | | Procedure Table | | | Contents | ]

main (93 to 127 script.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 117 | Pointer not checked for null before use : (arr)->buffer | CERT EXP08-C,EXP34-C
| 116 |  |
M | 117 | Pointer not checked for null before use : (arr)->element_size | CERT EXP08-C,EXP34-C
| 116 |  |
M | 117 | Pointer not checked for null before use : binary | CERT EXP08-C,EXP34-C
| 114 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
imem.h | 6 | script.c | 116 | default_pool
script.c | 17 | script.c | 116 | exec_args.arr.buffer
script.c | 17 | script.c | 116 | exec_args.arr.element_size
script.c | 17 | script.c | 116 | exec_args.v
script.c | 17 | script.c | 116 | exec_args.v_modifiable

[ | Top of Report | | | Procedure Table | | | Contents | ]

tcpwrap_client_handle (31 to 45 tcpwrap.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Procedure contains UR data flow anomalies. : request | CERT EXP33-C
| 36 |  |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
tcpwrap.c | 34 | tcpwrap.c | 36 | request

[ | Top of Report | | | Procedure Table | | | Contents | ]

tcpwrap_client_input (47 to 67 tcpwrap.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 56 | Array Bound exceeded. | CERT ARR30-C
M | 49 | Procedure contains UR data flow anomalies. : buf | CERT EXP33-C
| 53 |  |
C | 47 | Procedure not called in code analysed : tcpwrap_client_input |

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
tcpwrap.c | 49 | tcpwrap.c | 53 | buf

[ | Top of Report | | | Procedure Table | | | Contents | ]

tcpwrap_client_timeout (69 to 72 tcpwrap.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
C | 69 | Procedure not called in code analysed : tcpwrap_client_timeout |

[ | Top of Report | | | Procedure Table | | | Contents | ]

tcpwrap_client_create (74 to 84 tcpwrap.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 83 | Local structure returned in function result : client |
M | 79 | Pointer not checked for null before use : client | CERT EXP08-C,EXP34-C
| 78 |  |

[ | Top of Report | | | Procedure Table | | | Contents | ]

client_connected (102 to 111 tcpwrap.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
C | 102 | Procedure not called in code analysed : client_connected |

[ | Top of Report | | | Procedure Table | | | Contents | ]

### End of Code Review Report

###

### Copyright © 2010 Liverpool Data Research Associates