LDRA Testbed Code Review Report

LDRA Testbed ® Code Review Report

# System : Dovecot-src-lib

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:07:23 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 and Associated Source 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
--- | --- | --- | ---
19 | 47 S | Array Bound exceeded. | CERT ARR30-C
90 | 77 S | Macro replacement list needs parentheses. | CERT PRE02-C
69 | 78 S | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
3 | 403 S | Negative (or potentially negative) shift. | CERT INT34-C
17 | 483 S | free parameter is not heap item. | CERT MEM34-C
22 | 484 S | Attempt to use already freed object. | CERT MEM31-C
1 | 487 S | Insufficient space allocated. | CERT MEM35-C
3 | 489 S | Insufficient space for operation. | CERT DCL33-C,FIO43-C
17 | 577 S | Sizeof argument is a pointer. | CERT EXP01-C
89 | 5 D | Procedure contains UR data flow anomalies. | CERT EXP33-C
2276 | 45 D | Pointer not checked for null before use | CERT EXP08-C,EXP34-C
8 | 50 D | Memory not freed after last reference. | CERT MEM00-C
29 | 51 D | Attempt to read from freed memory. | CERT MEM30-C
16 | 57 D | Global not initialised at declaration. | CERT EXP33-C
136 | 69 D | Procedure contains UR data flow anomalies. | CERT EXP33-C
34 | 77 D | Local structure returned in function result |
16 | 86 D | User input not checked before use. | CERT FIO30-C
3 | 1 X | Declaration types do not match across a system. | CERT ARR31-C

Number of Violations | LDRA Code | (C) Checking (Mandatory) Standards | CERT Code
--- | --- | --- | ---

No Checking Standards Violated

Number of Violations | LDRA Code | (O) Optional Standards | CERT Code
--- | --- | --- | ---
2 | 592 S | Use of filename based functions. | CERT FIO01-C
14 | 80 D | Potentially unused function return value. | CERT FIO04-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 957 program components, 453 (47.34 %) pass ( of which 1 conditionally passes ) and 504 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 |  | t_abspath |  | abspath.c |  | 1 | - |  | 37 | - |
Pass |  | t_abspath_to |  | abspath.c |  | 0 |  | 0 |
FAIL |  | t_get_current_dir |  | abspath.c |  | 1 | - |  | 22 | - |
FAIL |  | t_readlink |  | abspath.c |  | 1 | - |  | 30 | - |
FAIL |  | t_binary_abspath |  | abspath.c |  | 1 | - |  | 26 | - |
Pass |  | buffer_get_data |  | buffer.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | buffer_get_used_size |  | buffer.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_create_from_buffer_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
FAIL |  | array_create_i |  | array.h analysed in aqueue.c |  | 1 | - |  | 17 | - |
Pass |  | array_free_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_is_created_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_get_pool_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_clear_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_append_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
FAIL |  | array_append_array_i |  | array.h analysed in aqueue.c |  | 1 | - |  | 17 | - |
Pass |  | array_insert_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_delete_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_get_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | array_idx_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
FAIL |  | array_get_modifiable_i |  | array.h analysed in aqueue.c |  | 1 | - |  | 20 | - |
Pass |  | array_append_space_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
FAIL |  | array_copy |  | array.h analysed in aqueue.c |  | 1 | - |  | 17 | - |
Pass |  | array_count_i |  | array.h analysed in aqueue.c |  | 0 |  | 0 |
Pass |  | aqueue_idx |  | aqueue.h analysed in aqueue.c |  | 0 |  | 0 |
FAIL |  | aqueue_init |  | aqueue.c |  | 1 | - |  | 18 | - |
FAIL |  | aqueue_deinit |  | aqueue.c |  | 1 | - |  | 14 | - |
FAIL |  | aqueue_grow |  | aqueue.c |  | 1 | - |  | 15 | - |
FAIL |  | aqueue_append |  | aqueue.c |  | 1 | - |  | 9 | - |
FAIL |  | aqueue_delete |  | aqueue.c |  | 1 | - |  | 9 | - |
Pass |  | aqueue_delete_tail |  | aqueue.c |  | 0 |  | 0 |
Pass |  | aqueue_clear |  | aqueue.c |  | 0 |  | 0 |
Pass |  | aqueue_count |  | aqueue.c |  | 0 |  | 0 |
FAIL |  | array_idx_modifiable_i |  | array.c |  | 1 | - |  | 18 | - |
FAIL |  | array_idx_set_i |  | array.c |  | 1 | - |  | 18 | - |
Pass |  | array_idx_clear_i |  | array.c |  | 0 |  | 0 |
FAIL |  | array_insert_space_i |  | array.c |  | 1 | - |  | 29 | - |
Pass |  | array_cmp_i |  | array.c |  | 0 |  | 0 |
FAIL |  | array_reverse_i |  | array.c |  | 1 | - |  | 18 | - |
FAIL |  | array_sort_i |  | array.c |  | 1 | - |  | 17 | - |
Pass |  | array_bsearch_i |  | array.c |  | 0 |  | 0 |
FAIL |  | askpass |  | askpass.c |  | 1 | - |  | 8 | - |
Pass |  | t_askpass |  | askpass.c |  | 0 |  | 0 |
FAIL |  | backtrace_append |  | backtrace-string.c |  | 1 | - |  | 19 | - |
FAIL |  | backtrace_get |  | backtrace-string.c |  | 1 | - |  | 29 | - |
Pass |  | base64_encode |  | base64.c |  | 0 |  | 0 |
Pass |  | base64_decode |  | base64.c |  | 0 |  | 0 |
FAIL |  | t_base64_decode_str |  | base64.c |  | 1 | - |  | 36 | - |
FAIL |  | bsearch_insert_pos |  | bsearch-insert-pos.c |  | 1 | - |  | 2 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | array_bsearch_insert_pos_i |  | bsearch-insert-pos.c |  | 0 |  | 0 |
FAIL |  | buffer_alloc |  | buffer.c |  | 1 | - |  | 5 | - |
FAIL |  | buffer_check_limits |  | buffer.c |  | 1 | - |  | 7 | - |
FAIL |  | buffer_create_data |  | buffer.c |  | 1 | - |  | 13 | - |
FAIL |  | buffer_create_const_data |  | buffer.c |  | 1 | - |  | 17 | - |
FAIL |  | buffer_create_dynamic |  | buffer.c |  | 1 | - |  | 17 | - |
FAIL |  | buffer_free |  | buffer.c |  | 1 | - |  | 5 | - |
FAIL |  | buffer_free_without_data |  | buffer.c |  | 1 | - |  | 11 | - |
Pass |  | buffer_get_pool |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_reset |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_write |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_append |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_append_c |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_insert |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_delete |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_write_zero |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_append_zero |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_insert_zero |  | buffer.c |  | 0 |  | 0 |
FAIL |  | buffer_copy |  | buffer.c |  | 1 | - |  | 6 | - |
Pass |  | buffer_append_buf |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_get_space_unsafe |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_append_space_unsafe |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_get_modifiable_data |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_set_used_size |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_get_size |  | buffer.c |  | 0 |  | 0 |
Pass |  | buffer_cmp |  | buffer.c |  | 0 |  | 0 |
FAIL |  | child_wait_new_with_pid |  | child-wait.c |  | 1 | - |  | 19 | - |
FAIL |  | child_wait_free |  | child-wait.c |  | 1 | - |  | 11 | - |
FAIL |  | child_wait_add_pid |  | child-wait.c |  | 1 | - |  | 17 | - |
FAIL |  | child_wait_remove_pid |  | child-wait.c |  | 1 | - |  | 17 | - |
FAIL |  | sigchld_handler |  | child-wait.c |  | 1 | - |  | 22 | - |
FAIL |  | child_wait_init |  | child-wait.c |  | 1 | - |  | 50 | - |
FAIL |  | child_wait_deinit |  | child-wait.c |  | 1 | - |  | 69 | - |
Pass |  | close_keep_errno |  | close-keep-errno.c |  | 0 |  | 0 |
Pass |  | i_my_pread |  | compat.c |  | 0 |  | 0 |
Pass |  | i_my_pwrite |  | compat.c |  | 0 |  | 0 |
Pass |  | crc32_data |  | crc32.c |  | 0 |  | 0 |
Pass |  | crc32_data_more |  | crc32.c |  | 0 |  | 0 |
Pass |  | crc32_str |  | crc32.c |  | 0 |  | 0 |
Pass |  | crc32_str_more |  | crc32.c |  | 0 |  | 0 |
Pass |  | data_stack_last_buffer_reset |  | data-stack.c |  | 0 |  | 0 |
FAIL |  | t_push |  | data-stack.c |  | 1 | - |  | 14 | - |
FAIL |  | free_blocks |  | data-stack.c |  | 1 | - |  | 2 | - |
FAIL |  | t_pop |  | data-stack.c |  | 1 | - |  | 7 | - |
FAIL |  | t_pop_check |  | data-stack.c |  | 1 | - |  | 20 | - |
FAIL |  | mem_block_alloc |  | data-stack.c |  | 1 | - |  | 10 | - |
FAIL |  | t_malloc_real |  | data-stack.c |  | 1 | - |  | 8 | - |
Pass |  | t_malloc |  | data-stack.c |  | 0 |  | 0 |
Pass |  | t_malloc0 |  | data-stack.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | t_try_realloc |  | data-stack.c |  | 0 |  | 0 |
Pass |  | t_get_bytes_available |  | data-stack.c |  | 0 |  | 0 |
FAIL |  | t_buffer_get |  | data-stack.c |  | 1 | - |  | 25 | - |
Pass |  | t_buffer_reget |  | data-stack.c |  | 0 |  | 0 |
FAIL |  | t_buffer_alloc |  | data-stack.c |  | 1 | - |  | 6 | - |
Pass |  | t_buffer_alloc_last_full |  | data-stack.c |  | 0 |  | 0 |
Pass |  | data_stack_set_clean_after_pop |  | data-stack.c |  | 0 |  | 0 |
FAIL |  | data_stack_init |  | data-stack.c |  | 1 | - |  | 36 | - |
FAIL |  | data_stack_deinit |  | data-stack.c |  | 1 | - |  | 17 | - |
Pass |  | is_in_group |  | eacces-error.c |  | 0 |  | 0 |
FAIL |  | test_access |  | eacces-error.c |  | 1 | - |  | 6 | - |
FAIL |  | eacces_error_get_full |  | eacces-error.c |  | 1 | - |  | 18 | - |
Pass |  | eacces_error_get |  | eacces-error.c |  | 0 |  | 0 |
Pass |  | eacces_error_get_creating |  | eacces-error.c |  | 0 |  | 0 |
FAIL |  | eperm_error_get_chgrp |  | eacces-error.c |  | 1 | - |  | 37 | - |
FAIL |  | env_put |  | env-util.c |  | 1 | - |  | 17 | - |
Pass |  | env_remove |  | env-util.c |  | 0 |  | 0 |
Pass |  | env_clean |  | env-util.c |  | 0 |  | 0 |
FAIL |  | env_backup_save |  | env-util.c |  | 1 | - |  | 13 | - |
FAIL |  | env_backup_restore |  | env-util.c |  | 1 | - |  | 12 | - |
Pass |  | env_backup_free |  | env-util.c |  | 0 |  | 0 |
Pass |  | env_deinit |  | env-util.c |  | 0 |  | 0 |
Pass |  | argv_drop_const |  | execv-const.c |  | 0 |  | 0 |
FAIL |  | execv_const |  | execv-const.c |  | 1 | - |  | 14 | - |
FAIL |  | execvp_const |  | execv-const.c |  | 1 | - |  | 14 | - |
Pass |  | get_log_stamp_format |  | failures.c |  | 0 |  | 0 |
Pass |  | failure_exit |  | failures.c |  | 0 |  | 0 |
FAIL |  | log_prefix_add |  | failures.c |  | 1 | - |  | 8 | - |
Pass |  | log_fd_flush_stop |  | failures.c |  | 0 |  | 0 |
FAIL |  | log_fd_write |  | failures.c |  | 1 | - |  | 18 | - |
FAIL |  | default_handler |  | failures.c |  | 1 | - |  | 38 | - |
FAIL |  | default_fatal_finish |  | failures.c |  | 1 | - |  | 6 | - |
FAIL |  | default_fatal_handler |  | failures.c |  | 1 | - |  | 19 | - |
FAIL |  | default_error_handler |  | failures.c |  | 1 | - |  | 7 | - |
Pass |  | i_log_type |  | failures.c |  | 0 |  | 0 |
Pass |  | i_panic |  | failures.c |  | 0 |  | 0 |
Pass |  | i_fatal |  | failures.c |  | 0 |  | 0 |
Pass |  | i_fatal_status |  | failures.c |  | 0 |  | 0 |
Pass |  | i_error |  | failures.c |  | 0 |  | 0 |
Pass |  | i_warning |  | failures.c |  | 0 |  | 0 |
Pass |  | i_info |  | failures.c |  | 0 |  | 0 |
Pass |  | i_debug |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_fatal_handler |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_error_handler |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_info_handler |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_debug_handler |  | failures.c |  | 0 |  | 0 |
Pass |  | i_get_failure_handlers |  | failures.c |  | 0 |  | 0 |
FAIL |  | syslog_handler |  | failures.c |  | 1 | - |  | 13 | - |
FAIL |  | i_syslog_fatal_handler |  | failures.c |  | 1 | - |  | 13 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | i_syslog_error_handler |  | failures.c |  | 1 | - |  | 5 | - |
Pass |  | i_set_failure_syslog |  | failures.c |  | 0 |  | 0 |
FAIL |  | open_log_file |  | failures.c |  | 1 | - |  | 14 | - |
FAIL |  | i_set_failure_file |  | failures.c |  | 1 | - |  | 12 | - |
FAIL |  | i_failure_send_option |  | failures.c |  | 1 | - |  | 29 | - |
FAIL |  | i_set_failure_prefix |  | failures.c |  | 1 | - |  | 60 | - |
FAIL |  | internal_send_split |  | failures.c |  | 1 | - |  | 38 | - |
FAIL |  | internal_handler |  | failures.c |  | 1 | - |  | 33 | - |
Pass |  | line_is_ok |  | failures.c |  | 0 |  | 0 |
FAIL |  | i_failure_parse_line |  | failures.c |  | 1 | - |  | 8 | - |
FAIL |  | i_internal_fatal_handler |  | failures.c |  | 1 | - |  | 13 | - |
Pass |  | i_internal_error_handler |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_failure_internal |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_failure_ignore_errors |  | failures.c |  | 0 |  | 0 |
FAIL |  | i_set_info_file |  | failures.c |  | 1 | - |  | 6 | - |
Pass |  | i_set_debug_file |  | failures.c |  | 0 |  | 0 |
FAIL |  | i_set_failure_timestamp_format |  | failures.c |  | 1 | - |  | 71 | - |
Pass |  | i_set_failure_ip |  | failures.c |  | 0 |  | 0 |
Pass |  | i_set_failure_exit_callback |  | failures.c |  | 0 |  | 0 |
FAIL |  | failures_deinit |  | failures.c |  | 1 | - |  | 8 | - |
FAIL |  | fd_close_on_exec |  | fd-close-on-exec.c |  | 1 | - |  | 9 | - |
FAIL |  | fd_debug_verify_leaks |  | fd-close-on-exec.c |  | 1 | - |  | 33 | - |
Pass |  | fd_set_nonblock |  | fd-set-nonblock.c |  | 0 |  | 0 |
Pass |  | fdatasync_path |  | fdatasync-path.c |  | 0 |  | 0 |
Pass |  | fd_send |  | fdpass.c |  | 0 |  | 0 |
Pass |  | fd_read |  | fdpass.c |  | 0 |  | 0 |
FAIL |  | file_cache_new |  | file-cache.c |  | 1 | - |  | 57 | - |
FAIL |  | file_cache_free |  | file-cache.c |  | 1 | - |  | 5 | - |
Pass |  | file_cache_set_fd |  | file-cache.c |  | 0 |  | 0 |
FAIL |  | file_cache_set_size |  | file-cache.c |  | 1 | - |  | 3 | - |
FAIL |  | file_cache_read |  | file-cache.c |  | 1 | - |  | 4 | - |
Pass |  | file_cache_get_map |  | file-cache.c |  | 0 |  | 0 |
FAIL |  | file_cache_write |  | file-cache.c |  | 1 | - |  | 15 | - |
FAIL |  | file_cache_invalidate |  | file-cache.c |  | 1 | - |  | 8 | - |
FAIL |  | file_copy_to_tmp |  | file-copy.c |  | 1 | - |  | 8 | - |
FAIL |  | file_copy |  | file-copy.c |  | 1 | - |  | 36 | - |
FAIL |  | file_dotlock_alloc |  | file-dotlock.c |  | 1 | - |  | 27 | - |
FAIL |  | read_local_pid |  | file-dotlock.c |  | 1 | - |  | 3 | - |
Pass |  | update_change_info |  | file-dotlock.c |  | 0 |  | 0 |
FAIL |  | update_lock_info |  | file-dotlock.c |  | 1 | - |  | 17 | - |
Pass |  | dotlock_override |  | file-dotlock.c |  | 0 |  | 0 |
FAIL |  | check_lock |  | file-dotlock.c |  | 1 | - |  | 8 | - |
FAIL |  | file_write_pid |  | file-dotlock.c |  | 1 | - |  | 15 | - |
FAIL |  | try_create_lock_hardlink |  | file-dotlock.c |  | 1 | - |  | 17 | - |
Pass |  | try_create_lock_excl |  | file-dotlock.c |  | 0 |  | 0 |
Pass |  | dotlock_wait_end |  | file-dotlock.c |  | 0 |  | 0 |
FAIL |  | dotlock_wait |  | file-dotlock.c |  | 1 | - |  | 25 | - |
FAIL |  | dotlock_create |  | file-dotlock.c |  | 1 | - |  | 10 | - |
FAIL |  | file_dotlock_free |  | file-dotlock.c |  | 1 | - |  | 23 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | file_dotlock_create_real |  | file-dotlock.c |  | 1 | - |  | 7 | - |
FAIL |  | file_dotlock_create |  | file-dotlock.c |  | 1 | - |  | 26 | - |
FAIL |  | dotlock_replaced_warning |  | file-dotlock.c |  | 1 | - |  | 13 | - |
FAIL |  | file_dotlock_delete |  | file-dotlock.c |  | 1 | - |  | 24 | - |
FAIL |  | file_dotlock_open |  | file-dotlock.c |  | 1 | - |  | 26 | - |
FAIL |  | file_dotlock_open_mode_full |  | file-dotlock.c |  | 1 | - |  | 16 | - |
FAIL |  | file_dotlock_open_mode |  | file-dotlock.c |  | 1 | - |  | 17 | - |
Pass |  | file_dotlock_open_group |  | file-dotlock.c |  | 0 |  | 0 |
FAIL |  | file_dotlock_replace |  | file-dotlock.c |  | 1 | - |  | 24 | - |
FAIL |  | file_dotlock_touch |  | file-dotlock.c |  | 1 | - |  | 24 | - |
FAIL |  | file_dotlock_is_locked |  | file-dotlock.c |  | 1 | - |  | 19 | - |
Pass |  | file_dotlock_get_lock_path |  | file-dotlock.c |  | 0 |  | 0 |
Pass |  | file_lock_method_parse |  | file-lock.c |  | 0 |  | 0 |
Pass |  | file_try_lock |  | file-lock.c |  | 0 |  | 0 |
FAIL |  | file_lock_do |  | file-lock.c |  | 1 | - |  | 1 | - |
FAIL |  | file_wait_lock |  | file-lock.c |  | 1 | - |  | 14 | - |
Pass |  | file_lock_try_update |  | file-lock.c |  | 0 |  | 0 |
FAIL |  | file_unlock |  | file-lock.c |  | 1 | - |  | 21 | - |
FAIL |  | file_lock_free |  | file-lock.c |  | 1 | - |  | 36 | - |
FAIL |  | file_set_size |  | file-set-size.c |  | 1 | - |  | 2 | - |
FAIL |  | hash2_alloc_table |  | hash2.c |  | 1 | - |  | 43 | - |
FAIL |  | hash2_create |  | hash2.c |  | 1 | - |  | 26 | - |
FAIL |  | hash2_destroy |  | hash2.c |  | 1 | - |  | 8 | - |
Pass |  | hash2_clear |  | hash2.c |  | 0 |  | 0 |
FAIL |  | hash2_resize |  | hash2.c |  | 1 | - |  | 7 | - |
FAIL |  | hash2_lookup |  | hash2.c |  | 1 | - |  | 7 | - |
FAIL |  | hash2_iterate |  | hash2.c |  | 1 | - |  | 3 | - |
Pass |  | hash2_insert |  | hash2.c |  | 0 |  | 0 |
FAIL |  | hash2_insert_hash |  | hash2.c |  | 1 | - |  | 23 | - |
FAIL |  | hash2_remove_value_p |  | hash2.c |  | 1 | - |  | 14 | - |
FAIL |  | hash2_remove |  | hash2.c |  | 1 | - |  | 14 | - |
FAIL |  | hash2_remove_iter |  | hash2.c |  | 1 | - |  | 17 | - |
Pass |  | hash2_count |  | hash2.c |  | 0 |  | 0 |
Pass |  | direct_cmp |  | hash.c |  | 0 |  | 0 |
Pass |  | direct_hash |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_create |  | hash.c |  | 1 | - |  | 6 | - |
FAIL |  | free_node |  | hash.c |  | 1 | - |  | 27 | - |
FAIL |  | destroy_node_list |  | hash.c |  | 1 | - |  | 14 | - |
Pass |  | hash_table_destroy_nodes |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_destroy |  | hash.c |  | 1 | - |  | 9 | - |
FAIL |  | hash_table_clear |  | hash.c |  | 1 | - |  | 3 | - |
Pass |  | hash_table_lookup_node |  | hash.c |  | 0 |  | 0 |
Pass |  | hash_table_lookup |  | hash.c |  | 0 |  | 0 |
Pass |  | hash_table_lookup_full |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_insert_node |  | hash.c |  | 1 | - |  | 11 | - |
FAIL |  | hash_table_insert |  | hash.c |  | 1 | - |  | 14 | - |
Pass |  | hash_table_update |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_compress |  | hash.c |  | 1 | - |  | 13 | - |
Pass |  | hash_table_compress_removed |  | hash.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | hash_table_remove |  | hash.c |  | 1 | - |  | 11 | - |
Pass |  | hash_table_count |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_iterate_init |  | hash.c |  | 1 | - |  | 30 | - |
FAIL |  | hash_table_iterate_next |  | hash.c |  | 1 | - |  | 7 | - |
FAIL |  | hash_table_iterate |  | hash.c |  | 1 | - |  | 7 | - |
FAIL |  | hash_table_iterate_deinit |  | hash.c |  | 1 | - |  | 20 | - |
Pass |  | hash_table_freeze |  | hash.c |  | 0 |  | 0 |
FAIL |  | hash_table_thaw |  | hash.c |  | 1 | - |  | 14 | - |
FAIL |  | hash_table_resize |  | hash.c |  | 1 | - |  | 11 | - |
FAIL |  | hash_table_copy |  | hash.c |  | 1 | - |  | 64 | - |
Pass |  | str_hash |  | hash.c |  | 0 |  | 0 |
Pass |  | strcase_hash |  | hash.c |  | 0 |  | 0 |
FAIL |  | binary_to_hex_case |  | hex-binary.c |  | 1 | - |  | 3 | - |
FAIL |  | binary_to_hex |  | hex-binary.c |  | 1 | - |  | 14 | - |
FAIL |  | binary_to_hex_ucase |  | hex-binary.c |  | 1 | - |  | 13 | - |
FAIL |  | binary_to_hex_append |  | hex-binary.c |  | 1 | - |  | 17 | - |
Pass |  | hex_to_binary |  | hex-binary.c |  | 0 |  | 0 |
Pass |  | dec2hex |  | hex-dec.c |  | 0 |  | 0 |
Pass |  | hex2dec |  | hex-dec.c |  | 0 |  | 0 |
Pass |  | hmac_md5_update |  | hmac-md5.h analysed in hmac-md5.c |  | 0 |  | 0 |
Pass |  | hmac_md5_init |  | hmac-md5.c |  | 0 |  | 0 |
Pass |  | hmac_md5_final |  | hmac-md5.c |  | 0 |  | 0 |
FAIL |  | hmac_md5_get_cram_context |  | hmac-md5.c |  | 1 | - |  | 2 | - |
FAIL |  | hmac_md5_set_cram_context |  | hmac-md5.c |  | 1 | - |  | 4 | - |
FAIL |  | home_try_expand |  | home-expand.c |  | 1 | - |  | 8 | - |
Pass |  | home_expand |  | home-expand.c |  | 0 |  | 0 |
Pass |  | home_expand_tilde |  | home-expand.c |  | 0 |  | 0 |
FAIL |  | hostpid_init |  | hostpid.c |  | 1 | - |  | 19 | - |
FAIL |  | my_hostdomain |  | hostpid.c |  | 1 | - |  | 13 | - |
Pass |  | i_malloc |  | imem.c |  | 0 |  | 0 |
Pass |  | i_realloc |  | imem.c |  | 0 |  | 0 |
FAIL |  | i_strdup |  | imem.c |  | 1 | - |  | 67 | - |
FAIL |  | i_strdup_empty |  | imem.c |  | 1 | - |  | 67 | - |
FAIL |  | i_strdup_until |  | imem.c |  | 1 | - |  | 67 | - |
FAIL |  | i_strndup |  | imem.c |  | 1 | - |  | 67 | - |
FAIL |  | i_strdup_printf |  | imem.c |  | 1 | - |  | 33 | - |
FAIL |  | i_strdup_vprintf |  | imem.c |  | 1 | - |  | 67 | - |
FAIL |  | i_strconcat |  | imem.c |  | 1 | - |  | 48 | - |
FAIL |  | io_loop_handler_init |  | ioloop-epoll.c |  | 1 | - |  | 26 | - |
FAIL |  | io_loop_handler_deinit |  | ioloop-epoll.c |  | 1 | - |  | 9 | - |
Pass |  | epoll_event_mask |  | ioloop-epoll.c |  | 0 |  | 0 |
FAIL |  | io_loop_handle_add |  | ioloop-epoll.c |  | 1 | - |  | 13 | - |
FAIL |  | io_loop_handle_remove |  | ioloop-epoll.c |  | 1 | - |  | 13 | - |
FAIL |  | io_loop_handler_run |  | ioloop-epoll.c |  | 1 | - |  | 13 | - |
FAIL |  | ioloop_iolist_add |  | ioloop-iolist.c |  | 1 | - |  | 6 | - |
Pass |  | ioloop_iolist_del |  | ioloop-iolist.c |  | 0 |  | 0 |
FAIL |  | io_notify_fd_add |  | ioloop-notify-fd.c |  | 1 | - |  | 16 | - |
Pass |  | io_notify_fd_free |  | ioloop-notify-fd.c |  | 0 |  | 0 |
FAIL |  | io_notify_fd_find |  | ioloop-notify-fd.c |  | 1 | - |  | 5 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | inotify_input_more |  | ioloop-notify-inotify.c |  | 1 | - |  | 7 | - |
Pass |  | inotify_input |  | ioloop-notify-inotify.c |  | 0 |  | 0 |
FAIL |  | io_add_notify |  | ioloop-notify-inotify.c |  | 1 | - |  | 6 | - |
FAIL |  | io_loop_notify_remove |  | ioloop-notify-inotify.c |  | 1 | - |  | 16 | - |
FAIL |  | io_loop_notify_handler_init |  | ioloop-notify-inotify.c |  | 1 | - |  | 18 | - |
FAIL |  | io_loop_notify_handler_deinit |  | ioloop-notify-inotify.c |  | 1 | - |  | 5 | - |
Pass |  | io_loop_initialize_handler |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | io_add |  | ioloop.c |  | 1 | - |  | 16 | - |
Pass |  | io_file_unlink |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | io_remove_full |  | ioloop.c |  | 1 | - |  | 11 | - |
Pass |  | io_remove |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | io_remove_closed |  | ioloop.c |  | 1 | - |  | 12 | - |
Pass |  | timeout_update_next |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | timeout_add |  | ioloop.c |  | 1 | - |  | 32 | - |
FAIL |  | timeout_remove |  | ioloop.c |  | 1 | - |  | 25 | - |
FAIL |  | timeout_reset_timeval |  | ioloop.c |  | 1 | - |  | 9 | - |
Pass |  | timeout_reset |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | timeout_get_wait_time |  | ioloop.c |  | 1 | - |  | 7 | - |
FAIL |  | io_loop_get_wait_time |  | ioloop.c |  | 1 | - |  | 4 | - |
Pass |  | timeout_cmp |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_loop_default_time_moved |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | io_loop_timeouts_update |  | ioloop.c |  | 1 | - |  | 7 | - |
FAIL |  | io_loops_timeouts_update |  | ioloop.c |  | 1 | - |  | 7 | - |
FAIL |  | io_loop_handle_timeouts_real |  | ioloop.c |  | 1 | - |  | 19 | - |
FAIL |  | io_loop_handle_timeouts |  | ioloop.c |  | 1 | - |  | 40 | - |
FAIL |  | io_loop_run |  | ioloop.c |  | 1 | - |  | 10 | - |
Pass |  | io_loop_stop |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_loop_set_running |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_loop_set_max_fd_count |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_loop_is_running |  | ioloop.c |  | 0 |  | 0 |
FAIL |  | io_loop_create |  | ioloop.c |  | 1 | - |  | 22 | - |
FAIL |  | io_loop_destroy |  | ioloop.c |  | 1 | - |  | 26 | - |
Pass |  | io_loop_set_tim _moved_callback |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_loop_set_current |  | ioloop.c |  | 0 |  | 0 |
Pass |  | io_stream_defau t_close_destroy |  | iostream.c |  | 0 |  | 0 |
Pass |  | io_stream_init |  | iostream.c |  | 0 |  | 0 |
Pass |  | io_stream_ref |  | iostream.c |  | 0 |  | 0 |
FAIL |  | io_stream_unref |  | iostream.c |  | 1 | - |  | 11 | - |
Pass |  | io_stream_close |  | iostream.c |  | 0 |  | 0 |
Pass |  | io_stream_set_max_buffer_size |  | iostream.c |  | 0 |  | 0 |
Pass |  | i_stream_concat_close |  | istream-concat.c |  | 0 |  | 0 |
Pass |  | i_stream_concat_destroy |  | istream-concat.c |  | 0 |  | 0 |
Pass |  | i_stream_concat set_max_buffer_size |  | istream-concat.c |  | 0 |  | 0 |
FAIL |  | i_stream_concat_read_next |  | istream-concat.c |  | 1 | - |  | 16 | - |
FAIL |  | i_stream_concat_read |  | istream-concat.c |  | 1 | - |  | 8 | - |
Pass |  | find_v_offset |  | istream-concat.c |  | 0 |  | 0 |
Pass |  | i_stream_concat_seek |  | istream-concat.c |  | 0 |  | 0 |
Pass |  | i_stream_concat_stat |  | istream-concat.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_concat |  | istream-concat.c |  | 1 | - |  | 6 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | i_stream_crlf_read_common |  | istream-crlf.c |  | 1 | - |  | 11 | - |
FAIL |  | i_stream_crlf_read_crlf |  | istream-crlf.c |  | 1 | - |  | 3 | - |
FAIL |  | i_stream_crlf_read_lf |  | istream-crlf.c |  | 1 | - |  | 3 | - |
Pass |  | i_stream_crlf_stat |  | istream-crlf.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_crlf_full |  | istream-crlf.c |  | 1 | - |  | 11 | - |
Pass |  | i_stream_create_crlf |  | istream-crlf.c |  | 0 |  | 0 |
Pass |  | i_stream_create_lf |  | istream-crlf.c |  | 0 |  | 0 |
Pass |  | i_stream_data_read |  | istream-data.c |  | 0 |  | 0 |
Pass |  | i_stream_data_seek |  | istream-data.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_from_data |  | istream-data.c |  | 1 | - |  | 19 | - |
Pass |  | i_stream_file_close |  | istream-file.c |  | 0 |  | 0 |
FAIL |  | i_stream_file_read |  | istream-file.c |  | 1 | - |  | 7 | - |
Pass |  | i_stream_file_seek |  | istream-file.c |  | 0 |  | 0 |
Pass |  | i_stream_file_sync |  | istream-file.c |  | 0 |  | 0 |
Pass |  | i_stream_file_stat |  | istream-file.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_fd |  | istream-file.c |  | 1 | - |  | 7 | - |
Pass |  | i_stream_limit_destroy |  | istream-limit.c |  | 0 |  | 0 |
Pass |  | i_stream_limit_read |  | istream-limit.c |  | 0 |  | 0 |
Pass |  | i_stream_limit_seek |  | istream-limit.c |  | 0 |  | 0 |
Pass |  | i_stream_limit_stat |  | istream-limit.c |  | 0 |  | 0 |
Pass |  | i_stream_limit_get_size |  | istream-limit.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_limit |  | istream-limit.c |  | 1 | - |  | 11 | - |
Pass |  | i_stream_mmap_close |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | i_stream_munmap |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | i_stream_mmap_destroy |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | mstream_get_mmap_block_size |  | istream-mmap.c |  | 0 |  | 0 |
FAIL |  | i_stream_mmap_read |  | istream-mmap.c |  | 1 | - |  | 4 | - |
Pass |  | i_stream_mmap_seek |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | i_stream_mmap_sync |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | fstat_cached |  | istream-mmap.c |  | 0 |  | 0 |
Pass |  | i_stream_mmap_stat |  | istream-mmap.c |  | 0 |  | 0 |
FAIL |  | i_stream_create_mmap |  | istream-mmap.c |  | 1 | - |  | 11 | - |
Pass |  | i_stream_seekable_close |  | istream-seekable.c |  | 0 |  | 0 |
FAIL |  | i_stream_seekable_destroy |  | istream-seekable.c |  | 1 | - |  | 6 | - |
Pass |  | i_stream_seekab e_set_max_buffer_size |  | istream-seekable.c |  | 0 |  | 0 |
FAIL |  | copy_to_temp_file |  | istream-seekable.c |  | 1 | - |  | 14 | - |
Pass |  | read_more |  | istream-seekable.c |  | 0 |  | 0 |
FAIL |  | read_from_buffer |  | istream-seekable.c |  | 1 | - |  | 8 | - |
FAIL |  | i_stream_seekable_write_failed |  | istream-seekable.c |  | 1 | - |  | 28 | - |
FAIL |  | i_stream_seekable_read |  | istream-seekable.c |  | 1 | - |  | 16 | - |
Pass |  | i_stream_seekable_seek |  | istream-seekable.c |  | 0 |  | 0 |
FAIL |  | i_stream_seekable_stat |  | istream-seekable.c |  | 1 | - |  | 9 | - |
FAIL |  | i_stream_create_seekable |  | istream-seekable.c |  | 1 | - |  | 10 | - |
FAIL |  | tee_streams_update_buffer |  | istream-tee.c |  | 1 | - |  | 3 | - |
Pass |  | tee_streams_skip |  | istream-tee.c |  | 0 |  | 0 |
Pass |  | i_stream_tee_close |  | istream-tee.c |  | 0 |  | 0 |
FAIL |  | i_stream_tee_destroy |  | istream-tee.c |  | 1 | - |  | 11 | - |
FAIL |  | i_stream_tee_set_max_buffer_size |  | istream-tee.c |  | 1 | - |  | 25 | - |
FAIL |  | i_stream_tee_read |  | istream-tee.c |  | 1 | - |  | 15 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | i_stream_tee_stat |  | istream-tee.c |  | 1 | - |  | 33 | - |
FAIL |  | i_stream_tee_sync |  | istream-tee.c |  | 1 | - |  | 27 | - |
FAIL |  | tee_i_stream_create |  | istream-tee.c |  | 1 | - |  | 43 | - |
FAIL |  | tee_i_stream_create_child |  | istream-tee.c |  | 1 | - |  | 22 | - |
Pass |  | tee_i_stream_child_is_waiting |  | istream-tee.c |  | 0 |  | 0 |
FAIL |  | i_stream_set_name |  | istream.c |  | 1 | - |  | 57 | - |
Pass |  | i_stream_get_name |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_destroy |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_ref |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_unref |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_set_destroy_callback |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_get_fd |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_close |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_set_init_buffer_size |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_set_max_buffer_size |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_set_re urn_partial_line |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_update |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_read |  | istream.c |  | 1 | - |  | 2 | - |
Conditional Pass |  | i_stream_read_copy_from_parent |  | istream.c |  | 1 | - |  | 4 | - |
Pass |  | i_stream_skip |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_can_optimize_seek |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_seek |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_seek_mark |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_sync |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_stat |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_get_size |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_have_bytes_left |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_is_eof |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_next_line_finish |  | istream.c |  | 1 | - |  | 11 | - |
Pass |  | i_stream_last_line |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_next_line |  | istream.c |  | 1 | - |  | 7 | - |
FAIL |  | i_stream_read_next_line |  | istream.c |  | 1 | - |  | 19 | - |
Pass |  | i_stream_get_data |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_get_modifiable_data |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_read_data |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_compress |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_grow_buffer |  | istream.c |  | 1 | - |  | 3 | - |
FAIL |  | i_stream_get_buffer_space |  | istream.c |  | 1 | - |  | 4 | - |
FAIL |  | i_stream_add_data |  | istream.c |  | 1 | - |  | 12 | - |
Pass |  | i_stream_defaul _set_max_buffer_size |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_default_destroy |  | istream.c |  | 1 | - |  | 20 | - |
FAIL |  | i_stream_default_seek |  | istream.c |  | 1 | - |  | 5 | - |
Pass |  | i_stream_default_stat |  | istream.c |  | 0 |  | 0 |
Pass |  | i_stream_default_get_size |  | istream.c |  | 0 |  | 0 |
FAIL |  | i_stream_create |  | istream.c |  | 1 | - |  | 1 | - |
Pass |  | lib_signal_code_to_str |  | lib-signals.c |  | 0 |  | 0 |
Pass |  | sig_handler |  | lib-signals.c |  | 0 |  | 0 |
Pass |  | sig_ignore |  | lib-signals.c |  | 0 |  | 0 |
FAIL |  | signal_read |  | lib-signals.c |  | 1 | - |  | 10 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | lib_signals_set |  | lib-signals.c |  | 1 | - |  | 9 | - |
FAIL |  | lib_signals_set_handler |  | lib-signals.c |  | 1 | - |  | 20 | - |
FAIL |  | lib_signals_ignore |  | lib-signals.c |  | 1 | - |  | 13 | - |
FAIL |  | lib_signals_unset_handler |  | lib-signals.c |  | 1 | - |  | 7 | - |
Pass |  | lib_signals_reset_ioloop |  | lib-signals.c |  | 0 |  | 0 |
Pass |  | lib_signals_init |  | lib-signals.c |  | 0 |  | 0 |
FAIL |  | lib_signals_deinit |  | lib-signals.c |  | 1 | - |  | 14 | - |
Pass |  | nearest_power |  | lib.c |  | 0 |  | 0 |
FAIL |  | lib_init |  | lib.c |  | 1 | - |  | 29 | - |
FAIL |  | lib_deinit |  | lib.c |  | 1 | - |  | 17 | - |
FAIL |  | body |  | md4.c |  | 1 | - |  | 1 | - |
Pass |  | md4_init |  | md4.c |  | 0 |  | 0 |
FAIL |  | md4_update |  | md4.c |  | 1 | - |  | 11 | - |
Pass |  | md4_final |  | md4.c |  | 0 |  | 0 |
FAIL |  | md4_get_digest |  | md4.c |  | 1 | - |  | 18 | - |
FAIL |  | body |  | md5.c |  | 1 | - |  | 1 | - |
Pass |  | md5_init |  | md5.c |  | 0 |  | 0 |
FAIL |  | md5_update |  | md5.c |  | 1 | - |  | 11 | - |
Pass |  | md5_final |  | md5.c |  | 0 |  | 0 |
FAIL |  | md5_get_digest |  | md5.c |  | 1 | - |  | 18 | - |
FAIL |  | pool_alloconly_create |  | mempool-alloconly.c |  | 1 | - |  | 31 | - |
FAIL |  | pool_alloconly_create_clean |  | mempool-alloconly.c |  | 1 | - |  | 20 | - |
FAIL |  | pool_alloconly_destroy |  | mempool-alloconly.c |  | 1 | - |  | 11 | - |
Pass |  | pool_alloconly_get_name |  | mempool-alloconly.c |  | 0 |  | 0 |
Pass |  | pool_alloconly_ref |  | mempool-alloconly.c |  | 0 |  | 0 |
Pass |  | pool_alloconly_unref |  | mempool-alloconly.c |  | 0 |  | 0 |
FAIL |  | block_alloc |  | mempool-alloconly.c |  | 1 | - |  | 6 | - |
FAIL |  | pool_alloconly_malloc |  | mempool-alloconly.c |  | 1 | - |  | 5 | - |
Pass |  | pool_alloconly_free |  | mempool-alloconly.c |  | 0 |  | 0 |
Pass |  | pool_try_grow |  | mempool-alloconly.c |  | 0 |  | 0 |
FAIL |  | pool_alloconly_realloc |  | mempool-alloconly.c |  | 1 | - |  | 6 | - |
FAIL |  | pool_alloconly_clear |  | mempool-alloconly.c |  | 1 | - |  | 8 | - |
Pass |  | pool_alloconly_ et_max_easy_alloc_size |  | mempool-alloconly.c |  | 0 |  | 0 |
Pass |  | pool_alloconly_ et_total_used_size |  | mempool-alloconly.c |  | 0 |  | 0 |
Pass |  | pool_alloconly_ et_total_alloc_size |  | mempool-alloconly.c |  | 0 |  | 0 |
FAIL |  | pool_datastack_create |  | mempool-datastack.c |  | 1 | - |  | 22 | - |
Pass |  | pool_data_stack_get_name |  | mempool-datastack.c |  | 0 |  | 0 |
Pass |  | pool_data_stack_ref |  | mempool-datastack.c |  | 0 |  | 0 |
FAIL |  | pool_data_stack_unref |  | mempool-datastack.c |  | 1 | - |  | 10 | - |
FAIL |  | pool_data_stack_malloc |  | mempool-datastack.c |  | 1 | - |  | 10 | - |
Pass |  | pool_data_stack_free |  | mempool-datastack.c |  | 0 |  | 0 |
FAIL |  | pool_data_stack_realloc |  | mempool-datastack.c |  | 1 | - |  | 18 | - |
Pass |  | pool_data_stack_clear |  | mempool-datastack.c |  | 0 |  | 0 |
Pass |  | pool_data_stack get_max_easy_alloc_size |  | mempool-datastack.c |  | 0 |  | 0 |
Pass |  | pool_system_clean_get_name |  | mempool-system-clean.c |  | 0 |  | 0 |
Pass |  | pool_system_clean_ref |  | mempool-system-clean.c |  | 0 |  | 0 |
Pass |  | pool_system_clean_unref |  | mempool-system-clean.c |  | 0 |  | 0 |
Pass |  | mem_get_size |  | mempool-system-clean.c |  | 0 |  | 0 |
FAIL |  | pool_system_clean_malloc |  | mempool-system-clean.c |  | 1 | - |  | 14 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | pool_system_clean_free |  | mempool-system-clean.c |  | 1 | - |  | 15 | - |
FAIL |  | pool_system_clean_realloc |  | mempool-system-clean.c |  | 1 | - |  | 4 | - |
Pass |  | pool_system_clean_clear |  | mempool-system-clean.c |  | 0 |  | 0 |
Pass |  | pool_system_cle n_get_max_easy_alloc_size |  | mempool-system-clean.c |  | 0 |  | 0 |
Pass |  | pool_system_get_name |  | mempool-system.c |  | 0 |  | 0 |
Pass |  | pool_system_ref |  | mempool-system.c |  | 0 |  | 0 |
Pass |  | pool_system_unref |  | mempool-system.c |  | 0 |  | 0 |
FAIL |  | pool_system_malloc |  | mempool-system.c |  | 1 | - |  | 13 | - |
FAIL |  | pool_system_free |  | mempool-system.c |  | 1 | - |  | 33 | - |
FAIL |  | pool_system_realloc |  | mempool-system.c |  | 1 | - |  | 8 | - |
Pass |  | pool_system_clear |  | mempool-system.c |  | 0 |  | 0 |
Pass |  | pool_system_get max_easy_alloc_size |  | mempool-system.c |  | 0 |  | 0 |
Pass |  | pool_unsafe_dat _stack_get_name |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
Pass |  | pool_unsafe_data_stack_ref |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
Pass |  | pool_unsafe_data_stack_unref |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
FAIL |  | pool_unsafe_data_stack_malloc |  | mempool-unsafe-datastack.c |  | 1 | - |  | 14 | - |
Pass |  | pool_unsafe_data_stack_free |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
FAIL |  | pool_unsafe_data_stack_realloc |  | mempool-unsafe-datastack.c |  | 1 | - |  | 16 | - |
Pass |  | pool_unsafe_data_stack_clear |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
Pass |  | pool_unsafe_dat _stack_get_max_easy_alloc_size |  | mempool-unsafe-datastack.c |  | 0 |  | 0 |
FAIL |  | pool_get_exp_grown_size |  | mempool.c |  | 1 | - |  | 13 | - |
FAIL |  | mkdir_chown_full |  | mkdir-parents.c |  | 1 | - |  | 8 | - |
FAIL |  | mkdir_chown |  | mkdir-parents.c |  | 1 | - |  | 17 | - |
Pass |  | mkdir_chgrp |  | mkdir-parents.c |  | 0 |  | 0 |
FAIL |  | mkdir_parents_chown_full |  | mkdir-parents.c |  | 1 | - |  | 18 | - |
FAIL |  | mkdir_parents_chown |  | mkdir-parents.c |  | 1 | - |  | 17 | - |
Pass |  | mkdir_parents_chgrp |  | mkdir-parents.c |  | 0 |  | 0 |
Pass |  | mkdir_parents |  | mkdir-parents.c |  | 0 |  | 0 |
Pass |  | mmap_anon |  | mmap-anon.c |  | 0 |  | 0 |
Pass |  | mremap_anon |  | mmap-anon.c |  | 0 |  | 0 |
Pass |  | munmap_anon |  | mmap-anon.c |  | 0 |  | 0 |
FAIL |  | mmap_file |  | mmap-util.c |  | 1 | - |  | 2 | - |
Pass |  | mmap_ro_file |  | mmap-util.c |  | 0 |  | 0 |
Pass |  | mmap_rw_file |  | mmap-util.c |  | 0 |  | 0 |
Pass |  | mmap_get_page_size |  | mmap-util.c |  | 0 |  | 0 |
Pass |  | module_get_symbol_quiet |  | module-dir.c |  | 0 |  | 0 |
FAIL |  | module_get_symbol |  | module-dir.c |  | 1 | - |  | 10 | - |
Pass |  | get_symbol |  | module-dir.c |  | 0 |  | 0 |
FAIL |  | module_free |  | module-dir.c |  | 1 | - |  | 23 | - |
FAIL |  | module_check_missing_dependencies |  | module-dir.c |  | 1 | - |  | 5 | - |
FAIL |  | module_load |  | module-dir.c |  | 1 | - |  | 20 | - |
FAIL |  | module_name_cmp |  | module-dir.c |  | 1 | - |  | 12 | - |
Pass |  | module_want_load |  | module-dir.c |  | 0 |  | 0 |
FAIL |  | check_duplicates |  | module-dir.c |  | 1 | - |  | 27 | - |
Pass |  | module_is_loaded |  | module-dir.c |  | 0 |  | 0 |
Pass |  | module_names_fix |  | module-dir.c |  | 0 |  | 0 |
Pass |  | module_dir_is_all_loaded |  | module-dir.c |  | 0 |  | 0 |
FAIL |  | module_dir_load_real |  | module-dir.c |  | 1 | - |  | 23 | - |
FAIL |  | module_dir_load_missing |  | module-dir.c |  | 1 | - |  | 43 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | module_dir_init |  | module-dir.c |  | 1 | - |  | 15 | - |
FAIL |  | module_dir_deinit |  | module-dir.c |  | 1 | - |  | 10 | - |
FAIL |  | module_dir_unload |  | module-dir.c |  | 1 | - |  | 35 | - |
FAIL |  | module_dir_load |  | module-dir.c |  | 1 | - |  | 17 | - |
FAIL |  | module_file_get_name |  | module-dir.c |  | 1 | - |  | 4 | - |
Pass |  | module_name_drop_suffix |  | module-dir.c |  | 0 |  | 0 |
Pass |  | module_get_plugin_name |  | module-dir.c |  | 0 |  | 0 |
FAIL |  | mountpoint_get |  | mountpoint.c |  | 1 | - |  | 2 | - |
Pass |  | net_ip_compare |  | network.c |  | 0 |  | 0 |
FAIL |  | net_ip_cmp |  | network.c |  | 1 | - |  | 11 | - |
FAIL |  | net_ip_hash |  | network.c |  | 1 | - |  | 6 | - |
FAIL |  | sin_set_ip |  | network.c |  | 1 | - |  | 8 | - |
FAIL |  | sin_get_ip |  | network.c |  | 1 | - |  | 13 | - |
Pass |  | sin_set_port |  | network.c |  | 0 |  | 0 |
Pass |  | sin_get_port |  | network.c |  | 0 |  | 0 |
FAIL |  | net_connect_ip |  | network.c |  | 1 | - |  | 5 | - |
Pass |  | net_try_bind |  | network.c |  | 0 |  | 0 |
Pass |  | net_connect_unix |  | network.c |  | 0 |  | 0 |
FAIL |  | net_connect_unix_with_retries |  | network.c |  | 1 | - |  | 17 | - |
Pass |  | net_disconnect |  | network.c |  | 0 |  | 0 |
FAIL |  | net_set_nonblock |  | network.c |  | 1 | - |  | 22 | - |
Pass |  | net_set_cork |  | network.c |  | 0 |  | 0 |
Pass |  | net_get_ip_any4 |  | network.c |  | 0 |  | 0 |
Pass |  | net_get_ip_any6 |  | network.c |  | 0 |  | 0 |
Pass |  | net_listen |  | network.c |  | 0 |  | 0 |
Pass |  | net_listen_unix |  | network.c |  | 0 |  | 0 |
FAIL |  | net_listen_unix_unlink_stale |  | network.c |  | 1 | - |  | 7 | - |
FAIL |  | net_accept |  | network.c |  | 1 | - |  | 8 | - |
FAIL |  | net_receive |  | network.c |  | 1 | - |  | 3 | - |
FAIL |  | net_transmit |  | network.c |  | 1 | - |  | 4 | - |
FAIL |  | net_gethostbyname |  | network.c |  | 1 | - |  | 6 | - |
FAIL |  | net_getsockname |  | network.c |  | 1 | - |  | 10 | - |
FAIL |  | net_getpeername |  | network.c |  | 1 | - |  | 10 | - |
Pass |  | net_getunixname |  | network.c |  | 0 |  | 0 |
Pass |  | net_ip2addr |  | network.c |  | 0 |  | 0 |
FAIL |  | net_addr2ip |  | network.c |  | 1 | - |  | 10 | - |
Pass |  | net_ipv6_mapped_ipv4_convert |  | network.c |  | 0 |  | 0 |
FAIL |  | net_geterror |  | network.c |  | 1 | - |  | 18 | - |
Pass |  | net_gethosterror |  | network.c |  | 0 |  | 0 |
Pass |  | net_hosterror_notfound |  | network.c |  | 0 |  | 0 |
Pass |  | net_getservbyport |  | network.c |  | 0 |  | 0 |
Pass |  | is_ipv4_address |  | network.c |  | 0 |  | 0 |
Pass |  | is_ipv6_address |  | network.c |  | 0 |  | 0 |
FAIL |  | net_parse_range |  | network.c |  | 1 | - |  | 10 | - |
FAIL |  | net_is_in_network |  | network.c |  | 1 | - |  | 5 | - |
Pass |  | nfs_safe_do |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_safe_open_callback |  | nfs-workarounds.c |  | 0 |  | 0 |
FAIL |  | nfs_safe_open |  | nfs-workarounds.c |  | 1 | - |  | 21 | - |
Pass |  | nfs_safe_stat_callback |  | nfs-workarounds.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | nfs_safe_stat |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_safe_lstat_callback |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_safe_lstat |  | nfs-workarounds.c |  | 0 |  | 0 |
FAIL |  | nfs_safe_link |  | nfs-workarounds.c |  | 1 | - |  | 2 | - |
FAIL |  | nfs_flush_chown_uid |  | nfs-workarounds.c |  | 1 | - |  | 2 | - |
Pass |  | nfs_flush_attr_cache_unlocked |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_flush_attr_ ache_maybe_locked |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_flush_attr_cache_fd_locked |  | nfs-workarounds.c |  | 0 |  | 0 |
FAIL |  | nfs_flush_file_handle_cache_dir |  | nfs-workarounds.c |  | 1 | - |  | 11 | - |
FAIL |  | nfs_flush_file_handle_cache_parent_dir |  | nfs-workarounds.c |  | 1 | - |  | 32 | - |
Pass |  | nfs_flush_file_handle_cache |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_flush_read_cache_locked |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | nfs_flush_read_cache_unlocked |  | nfs-workarounds.c |  | 0 |  | 0 |
Pass |  | o_stream_buffer_seek |  | ostream-buffer.c |  | 0 |  | 0 |
Pass |  | o_stream_buffer_write_at |  | ostream-buffer.c |  | 0 |  | 0 |
Pass |  | o_stream_buffer_sendv |  | ostream-buffer.c |  | 0 |  | 0 |
FAIL |  | o_stream_create_buffer |  | ostream-buffer.c |  | 1 | - |  | 20 | - |
FAIL |  | stream_closed |  | ostream-file.c |  | 1 | - |  | 7 | - |
FAIL |  | o_stream_file_close |  | ostream-file.c |  | 1 | - |  | 33 | - |
FAIL |  | o_stream_file_destroy |  | ostream-file.c |  | 1 | - |  | 17 | - |
FAIL |  | file_buffer_get_used_size |  | ostream-file.c |  | 1 | - |  | 6 | - |
Pass |  | update_buffer |  | ostream-file.c |  | 0 |  | 0 |
Pass |  | o_stream_socket_cork |  | ostream-file.c |  | 0 |  | 0 |
Pass |  | o_stream_lseek |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | o_stream_writev |  | ostream-file.c |  | 1 | - |  | 5 | - |
Pass |  | o_stream_fill_iovec |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | buffer_flush |  | ostream-file.c |  | 1 | - |  | 16 | - |
FAIL |  | o_stream_file_cork |  | ostream-file.c |  | 1 | - |  | 4 | - |
Pass |  | o_stream_file_flush |  | ostream-file.c |  | 0 |  | 0 |
Pass |  | o_stream_file_flush_pending |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | get_unused_space |  | ostream-file.c |  | 1 | - |  | 6 | - |
Pass |  | o_stream_file_get_used_size |  | ostream-file.c |  | 0 |  | 0 |
Pass |  | o_stream_file_seek |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | o_stream_grow_buffer |  | ostream-file.c |  | 1 | - |  | 2 | - |
FAIL |  | stream_send_io |  | ostream-file.c |  | 1 | - |  | 3 | - |
Pass |  | o_stream_add |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | o_stream_file_sendv |  | ostream-file.c |  | 1 | - |  | 7 | - |
FAIL |  | o_stream_file_update_buffer |  | ostream-file.c |  | 1 | - |  | 2 | - |
FAIL |  | o_stream_file_write_at |  | ostream-file.c |  | 1 | - |  | 7 | - |
FAIL |  | io_stream_sendfile |  | ostream-file.c |  | 1 | - |  | 5 | - |
FAIL |  | io_stream_copy_backwards |  | ostream-file.c |  | 1 | - |  | 6 | - |
FAIL |  | io_stream_copy_stream |  | ostream-file.c |  | 1 | - |  | 6 | - |
FAIL |  | o_stream_file_send_istream |  | ostream-file.c |  | 1 | - |  | 9 | - |
FAIL |  | o_stream_create_fd_common |  | ostream-file.c |  | 1 | - |  | 11 | - |
Pass |  | fstream_init_file |  | ostream-file.c |  | 0 |  | 0 |
FAIL |  | o_stream_create_fd |  | ostream-file.c |  | 1 | - |  | 2 | - |
FAIL |  | o_stream_create_fd_file |  | ostream-file.c |  | 1 | - |  | 5 | - |
FAIL |  | o_stream_set_name |  | ostream.c |  | 1 | - |  | 57 | - |
Pass |  | o_stream_get_name |  | ostream.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | o_stream_destroy |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_ref |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_unref |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_close |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_set_flush_callback |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_unset_flush_callback |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_set_max_buffer_size |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_cork |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_uncork |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_flush |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_set_flush_pending |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_get_buffer_used_size |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_get_buffer_avail_size |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_seek |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_send |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_sendv |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_send_str |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_send_istream |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_pwrite |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_default_send_istream |  | ostream.c |  | 0 |  | 0 |
Pass |  | o_stream_create |  | ostream.c |  | 0 |  | 0 |
FAIL |  | io_stream_copy |  | ostream.c |  | 1 | - |  | 13 | - |
Pass |  | primes_closest |  | primes.c |  | 0 |  | 0 |
FAIL |  | fix_format_real |  | printf-format-fix.c |  | 1 | - |  | 14 | - |
FAIL |  | printf_format_fix_noalloc |  | printf-format-fix.c |  | 1 | - |  | 6 | - |
FAIL |  | printf_format_fix_get_len |  | printf-format-fix.c |  | 1 | - |  | 15 | - |
FAIL |  | printf_format_fix |  | printf-format-fix.c |  | 1 | - |  | 15 | - |
Pass |  | printf_format_fix_unsafe |  | printf-format-fix.c |  | 0 |  | 0 |
FAIL |  | priorityq_init |  | priorityq.c |  | 1 | - |  | 44 | - |
FAIL |  | priorityq_deinit |  | priorityq.c |  | 1 | - |  | 10 | - |
Pass |  | priorityq_count |  | priorityq.c |  | 0 |  | 0 |
FAIL |  | heap_items_swap |  | priorityq.c |  | 1 | - |  | 12 | - |
FAIL |  | heap_item_bubble_up |  | priorityq.c |  | 1 | - |  | 14 | - |
FAIL |  | heap_item_bubble_down |  | priorityq.c |  | 1 | - |  | 5 | - |
FAIL |  | priorityq_add |  | priorityq.c |  | 1 | - |  | 18 | - |
FAIL |  | priorityq_remove_idx |  | priorityq.c |  | 1 | - |  | 17 | - |
Pass |  | priorityq_remove |  | priorityq.c |  | 0 |  | 0 |
Pass |  | priorityq_peek |  | priorityq.c |  | 0 |  | 0 |
Pass |  | priorityq_pop |  | priorityq.c |  | 0 |  | 0 |
Pass |  | priorityq_items |  | priorityq.c |  | 0 |  | 0 |
FAIL |  | proctitle_hack_init |  | process-title.c |  | 1 | - |  | 6 | - |
FAIL |  | argv_dup |  | process-title.c |  | 1 | - |  | 10 | - |
Pass |  | proctitle_hack_set |  | process-title.c |  | 0 |  | 0 |
FAIL |  | process_title_init |  | process-title.c |  | 1 | - |  | 25 | - |
FAIL |  | process_title_set |  | process-title.c |  | 1 | - |  | 14 | - |
FAIL |  | process_title_deinit |  | process-title.c |  | 1 | - |  | 50 | - |
FAIL |  | random_fill |  | randgen.c |  | 1 | - |  | 7 | - |
FAIL |  | random_init |  | randgen.c |  | 1 | - |  | 16 | - |
Pass |  | random_deinit |  | randgen.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | random_fill_weak |  | randgen.c |  | 0 |  | 0 |
FAIL |  | read_full |  | read-full.c |  | 1 | - |  | 8 | - |
FAIL |  | pread_full |  | read-full.c |  | 1 | - |  | 4 | - |
FAIL |  | restrict_access_init |  | restrict-access.c |  | 1 | - |  | 17 | - |
Pass |  | get_uid_str |  | restrict-access.c |  | 0 |  | 0 |
Pass |  | get_gid_str |  | restrict-access.c |  | 0 |  | 0 |
FAIL |  | restrict_init_groups |  | restrict-access.c |  | 1 | - |  | 27 | - |
FAIL |  | restrict_get_groups_list |  | restrict-access.c |  | 1 | - |  | 18 | - |
Pass |  | drop_restricted_groups |  | restrict-access.c |  | 0 |  | 0 |
FAIL |  | get_group_id |  | restrict-access.c |  | 1 | - |  | 10 | - |
FAIL |  | fix_groups_list |  | restrict-access.c |  | 1 | - |  | 14 | - |
FAIL |  | restrict_access |  | restrict-access.c |  | 1 | - |  | 15 | - |
FAIL |  | restrict_access_set_env |  | restrict-access.c |  | 1 | - |  | 31 | - |
Pass |  | null_if_empty |  | restrict-access.c |  | 0 |  | 0 |
FAIL |  | restrict_access_get_env |  | restrict-access.c |  | 1 | - |  | 10 | - |
FAIL |  | restrict_access_by_env |  | restrict-access.c |  | 1 | - |  | 100 |
Pass |  | restrict_access get_current_chroot |  | restrict-access.c |  | 0 |  | 0 |
Pass |  | restrict_access allow_coredumps |  | restrict-access.c |  | 0 |  | 0 |
FAIL |  | restrict_access_use_priv_gid |  | restrict-access.c |  | 1 | - |  | 6 | - |
Pass |  | restrict_access_drop_priv_gid |  | restrict-access.c |  | 0 |  | 0 |
Pass |  | restrict_access_have_priv_gid |  | restrict-access.c |  | 0 |  | 0 |
FAIL |  | restrict_process_size |  | restrict-process-size.c |  | 1 | - |  | 10 | - |
Pass |  | restrict_fd_limit |  | restrict-process-size.c |  | 0 |  | 0 |
Pass |  | restrict_get_core_limit |  | restrict-process-size.c |  | 0 |  | 0 |
Pass |  | safe_memset |  | safe-memset.c |  | 0 |  | 0 |
FAIL |  | safe_mkdir |  | safe-mkdir.c |  | 1 | - |  | 18 | - |
FAIL |  | safe_mkstemp_full |  | safe-mkstemp.c |  | 1 | - |  | 18 | - |
FAIL |  | safe_mkstemp |  | safe-mkstemp.c |  | 1 | - |  | 17 | - |
Pass |  | safe_mkstemp_group |  | safe-mkstemp.c |  | 0 |  | 0 |
FAIL |  | safe_mkstemp_hostpid |  | safe-mkstemp.c |  | 1 | - |  | 29 | - |
FAIL |  | safe_mkstemp_hostpid_group |  | safe-mkstemp.c |  | 1 | - |  | 29 | - |
Pass |  | safe_sendfile |  | sendfile-util.c |  | 0 |  | 0 |
Pass |  | seq_range_lookup |  | seq-range-array.c |  | 0 |  | 0 |
FAIL |  | seq_range_array_add |  | seq-range-array.c |  | 1 | - |  | 5 | - |
FAIL |  | seq_range_array_add_range |  | seq-range-array.c |  | 1 | - |  | 2 | - |
Pass |  | seq_range_array_merge |  | seq-range-array.c |  | 0 |  | 0 |
Pass |  | seq_range_array_remove |  | seq-range-array.c |  | 0 |  | 0 |
FAIL |  | seq_range_array_remove_range |  | seq-range-array.c |  | 1 | - |  | 8 | - |
Pass |  | seq_range_array remove_seq_range |  | seq-range-array.c |  | 0 |  | 0 |
FAIL |  | seq_range_array_intersect |  | seq-range-array.c |  | 1 | - |  | 6 | - |
Pass |  | seq_range_exists |  | seq-range-array.c |  | 0 |  | 0 |
FAIL |  | seq_range_array_have_common |  | seq-range-array.c |  | 1 | - |  | 8 | - |
Pass |  | seq_range_count |  | seq-range-array.c |  | 0 |  | 0 |
FAIL |  | seq_range_array_invert |  | seq-range-array.c |  | 1 | - |  | 8 | - |
FAIL |  | seq_range_array_iter_init |  | seq-range-array.c |  | 1 | - |  | 25 | - |
FAIL |  | seq_range_array_iter_nth |  | seq-range-array.c |  | 1 | - |  | 2 | - |
Pass |  | sha1_step |  | sha1.c |  | 0 |  | 0 |
FAIL |  | sha1_init |  | sha1.c |  | 1 | - |  | 8 | - |
Pass |  | sha1_pad |  | sha1.c |  | 0 |  | 0 |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
Pass |  | sha1_loop |  | sha1.c |  | 0 |  | 0 |
FAIL |  | sha1_result_libmysqlclient_craps_all_over |  | sha1.c |  | 1 | - |  | 44 | - |
FAIL |  | sha1_get_digest |  | sha1.c |  | 1 | - |  | 73 | - |
FAIL |  | sha256_transf |  | sha2.c |  | 1 | - |  | 1 | - |
Pass |  | sha256_init |  | sha2.c |  | 0 |  | 0 |
FAIL |  | sha256_loop |  | sha2.c |  | 1 | - |  | 8 | - |
Pass |  | sha256_result |  | sha2.c |  | 0 |  | 0 |
FAIL |  | sha256_get_digest |  | sha2.c |  | 1 | - |  | 18 | - |
FAIL |  | sha512_transf |  | sha2.c |  | 1 | - |  | 1 | - |
Pass |  | sha512_init |  | sha2.c |  | 0 |  | 0 |
FAIL |  | sha512_loop |  | sha2.c |  | 1 | - |  | 8 | - |
Pass |  | sha512_result |  | sha2.c |  | 0 |  | 0 |
FAIL |  | sha512_get_digest |  | sha2.c |  | 1 | - |  | 18 | - |
Pass |  | init_badtab |  | str-find.c |  | 0 |  | 0 |
FAIL |  | init_suffixes |  | str-find.c |  | 1 | - |  | 2 | - |
Pass |  | init_goodtab |  | str-find.c |  | 0 |  | 0 |
FAIL |  | str_find_init |  | str-find.c |  | 1 | - |  | 24 | - |
FAIL |  | str_find_deinit |  | str-find.c |  | 1 | - |  | 47 | - |
Pass |  | str_find_more |  | str-find.c |  | 0 |  | 0 |
Pass |  | str_find_get_match_end_pos |  | str-find.c |  | 0 |  | 0 |
Pass |  | str_find_reset |  | str-find.c |  | 0 |  | 0 |
Pass |  | uni_utf8_char_bytes |  | unichar.h analysed in str-sanitize.c |  | 0 |  | 0 |
Pass |  | str_sanitize_skip_start |  | str-sanitize.c |  | 0 |  | 0 |
FAIL |  | str_sanitize_append |  | str-sanitize.c |  | 1 | - |  | 13 | - |
FAIL |  | str_sanitize |  | str-sanitize.c |  | 1 | - |  | 24 | - |
Pass |  | str_new |  | str.c |  | 0 |  | 0 |
FAIL |  | str_new_const |  | str.c |  | 1 | - |  | 26 | - |
FAIL |  | t_str_new |  | str.c |  | 1 | - |  | 29 | - |
FAIL |  | t_str_new_const |  | str.c |  | 1 | - |  | 29 | - |
Pass |  | str_free |  | str.c |  | 0 |  | 0 |
FAIL |  | str_add_nul |  | str.c |  | 1 | - |  | 11 | - |
Pass |  | str_free_without_data |  | str.c |  | 0 |  | 0 |
FAIL |  | str_c |  | str.c |  | 1 | - |  | 11 | - |
FAIL |  | str_data |  | str.c |  | 1 | - |  | 17 | - |
FAIL |  | str_c_modifiable |  | str.c |  | 1 | - |  | 17 | - |
Pass |  | str_len |  | str.c |  | 0 |  | 0 |
Pass |  | str_equals |  | str.c |  | 0 |  | 0 |
Pass |  | str_append |  | str.c |  | 0 |  | 0 |
Pass |  | str_append_n |  | str.c |  | 0 |  | 0 |
Pass |  | str_append_c |  | str.c |  | 0 |  | 0 |
FAIL |  | str_append_str |  | str.c |  | 1 | - |  | 50 | - |
Pass |  | str_printfa |  | str.c |  | 0 |  | 0 |
FAIL |  | str_vprintfa |  | str.c |  | 1 | - |  | 38 | - |
Pass |  | str_insert |  | str.c |  | 0 |  | 0 |
Pass |  | str_delete |  | str.c |  | 0 |  | 0 |
Pass |  | str_truncate |  | str.c |  | 0 |  | 0 |
FAIL |  | str_escape |  | strescape.c |  | 1 | - |  | 11 | - |
FAIL |  | str_append_unescaped |  | strescape.c |  | 1 | - |  | 10 | - |
FAIL |  | str_unescape |  | strescape.c |  | 1 | - |  | 7 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | str_tabescape_write |  | strescape.c |  | 1 | - |  | 29 | - |
FAIL |  | str_tabescape |  | strescape.c |  | 1 | - |  | 27 | - |
FAIL |  | str_append_tabunescaped |  | strescape.c |  | 1 | - |  | 7 | - |
FAIL |  | str_tabunescape |  | strescape.c |  | 1 | - |  | 4 | - |
FAIL |  | i_snprintf |  | strfuncs.c |  | 1 | - |  | 13 | - |
FAIL |  | p_strdup |  | strfuncs.c |  | 1 | - |  | 4 | - |
Pass |  | p_strdup_empty |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | p_strdup_until |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | p_strndup |  | strfuncs.c |  | 1 | - |  | 3 | - |
Pass |  | p_strdup_printf |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | t_noalloc_strdup_vprintf |  | strfuncs.c |  | 1 | - |  | 39 | - |
FAIL |  | p_strdup_vprintf |  | strfuncs.c |  | 1 | - |  | 14 | - |
FAIL |  | vstrconcat |  | strfuncs.c |  | 1 | - |  | 18 | - |
FAIL |  | p_strconcat |  | strfuncs.c |  | 1 | - |  | 24 | - |
FAIL |  | t_strdup |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strdup_noconst |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strdup_empty |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strdup_until |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strndup |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strdup_printf |  | strfuncs.c |  | 1 | - |  | 13 | - |
FAIL |  | t_strdup_vprintf |  | strfuncs.c |  | 1 | - |  | 17 | - |
FAIL |  | t_strconcat |  | strfuncs.c |  | 1 | - |  | 27 | - |
Pass |  | t_strcut |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | i_strocpy |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | str_ucase |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | str_lcase |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | t_str_lcase |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | t_str_ucase |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | null_strcmp |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | i_memcasecmp |  | strfuncs.c |  | 1 | - |  | 8 | - |
Pass |  | bsearch_strcmp |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | i_strcmp_p |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | bsearch_strcasecmp |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | i_strcasecmp_p |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | split_str |  | strfuncs.c |  | 1 | - |  | 5 | - |
FAIL |  | t_strsplit |  | strfuncs.c |  | 1 | - |  | 14 | - |
FAIL |  | t_strsplit_spaces |  | strfuncs.c |  | 1 | - |  | 13 | - |
Pass |  | p_strsplit |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | p_strsplit_spaces |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | p_strsplit_free |  | strfuncs.c |  | 1 | - |  | 40 | - |
Pass |  | str_array_length |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | t_strarray_join |  | strfuncs.c |  | 1 | - |  | 13 | - |
FAIL |  | str_array_remove |  | strfuncs.c |  | 1 | - |  | 6 | - |
Pass |  | str_array_find |  | strfuncs.c |  | 0 |  | 0 |
Pass |  | str_array_icase_find |  | strfuncs.c |  | 0 |  | 0 |
FAIL |  | p_strarray_dup |  | strfuncs.c |  | 1 | - |  | 5 | - |
FAIL |  | dec2str |  | strfuncs.c |  | 1 | - |  | 7 | - |
Pass |  | str_is_numeric |  | strnum.c |  | 0 |  | 0 |
FAIL |  | str_to_uint |  | strnum.c |  | 1 | - |  | 10 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | str_to_ulong |  | strnum.c |  | 1 | - |  | 10 | - |
FAIL |  | str_to_ullong |  | strnum.c |  | 1 | - |  | 10 | - |
FAIL |  | str_to_uint32 |  | strnum.c |  | 1 | - |  | 10 | - |
FAIL |  | str_to_uint64 |  | strnum.c |  | 1 | - |  | 10 | - |
Pass |  | str_to_uintmax |  | strnum.c |  | 0 |  | 0 |
FAIL |  | str_to_int |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_long |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_llong |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_intmax |  | strnum.c |  | 1 | - |  | 4 | - |
Pass |  | verify_xid |  | strnum.c |  | 0 |  | 0 |
FAIL |  | str_to_uid |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_gid |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_pid |  | strnum.c |  | 1 | - |  | 9 | - |
FAIL |  | str_to_uoff |  | strnum.c |  | 1 | - |  | 10 | - |
FAIL |  | str_uint_equals |  | strnum.c |  | 1 | - |  | 17 | - |
Pass |  | str_num_error |  | strnum.c |  | 0 |  | 0 |
FAIL |  | aqueue_is_ok |  | test-aqueue.c |  | 1 | - |  | 3 | - |
FAIL |  | test_aqueue2 |  | test-aqueue.c |  | 1 | - |  | 18 | - |
FAIL |  | test_aqueue |  | test-aqueue.c |  | 1 | - |  | 29 | - |
FAIL |  | test_array_foreach |  | test-array.c |  | 1 | - |  | 13 | - |
FAIL |  | test_array_reverse |  | test-array.c |  | 1 | - |  | 26 | - |
FAIL |  | test_array |  | test-array.c |  | 1 | - |  | 33 | - |
FAIL |  | test_base64_encode |  | test-base64.c |  | 1 | - |  | 28 | - |
FAIL |  | test_base64_decode |  | test-base64.c |  | 1 | - |  | 17 | - |
FAIL |  | test_base64_random |  | test-base64.c |  | 1 | - |  | 31 | - |
FAIL |  | test_base64 |  | test-base64.c |  | 1 | - |  | 50 | - |
Pass |  | cmp_uint |  | test-bsearch-insert-pos.c |  | 0 |  | 0 |
FAIL |  | test_bsearch_insert_pos |  | test-bsearch-insert-pos.c |  | 1 | - |  | 3 | - |
FAIL |  | test_buffer |  | test-buffer.c |  | 1 | - |  | 5 | - |
Pass |  | test_crc32 |  | test-crc32.c |  | 0 |  | 0 |
FAIL |  | test_binary_to_hex |  | test-hex-binary.c |  | 1 | - |  | 35 | - |
FAIL |  | test_hex_to_binary |  | test-hex-binary.c |  | 1 | - |  | 10 | - |
FAIL |  | test_hex_binary |  | test-hex-binary.c |  | 1 | - |  | 33 | - |
FAIL |  | test_istream_concat_one |  | test-istream-concat.c |  | 1 | - |  | 8 | - |
FAIL |  | test_istream_concat_random |  | test-istream-concat.c |  | 1 | - |  | 8 | - |
FAIL |  | test_istream_concat |  | test-istream-concat.c |  | 1 | - |  | 17 | - |
FAIL |  | test_istream_crlf_input |  | test-istream-crlf.c |  | 1 | - |  | 18 | - |
FAIL |  | test_istream_crlf |  | test-istream-crlf.c |  | 1 | - |  | 6 | - |
FAIL |  | fd_callback |  | test-istream-seekable.c |  | 1 | - |  | 6 | - |
FAIL |  | test_istream_seekable_one |  | test-istream-seekable.c |  | 1 | - |  | 11 | - |
FAIL |  | test_istream_seekable_random |  | test-istream-seekable.c |  | 1 | - |  | 8 | - |
FAIL |  | test_istream_seekable_eof |  | test-istream-seekable.c |  | 1 | - |  | 22 | - |
FAIL |  | test_istream_seekable |  | test-istream-seekable.c |  | 1 | - |  | 22 | - |
FAIL |  | test_istream_tee_tailing |  | test-istream-tee.c |  | 1 | - |  | 8 | - |
FAIL |  | test_istream_tee_blocks |  | test-istream-tee.c |  | 1 | - |  | 16 | - |
FAIL |  | test_istream_tee |  | test-istream-tee.c |  | 1 | - |  | 52 | - |
Pass |  | main |  | test-lib.c |  | 0 |  | 0 |
FAIL |  | test_dllist |  | test-llist.c |  | 1 | - |  | 3 | - |
FAIL |  | test_dllist2 |  | test-llist.c |  | 1 | - |  | 2 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | test_llist |  | test-llist.c |  | 1 | - |  | 33 | - |
Pass |  | mem_has_bytes |  | test-mempool-alloconly.c |  | 0 |  | 0 |
FAIL |  | test_mempool_alloconly |  | test-mempool-alloconly.c |  | 1 | - |  | 3 | - |
FAIL |  | test_net_is_in_network |  | test-network.c |  | 1 | - |  | 83 | - |
Pass |  | test_network |  | test-network.c |  | 0 |  | 0 |
Pass |  | test_primes |  | test-primes.c |  | 0 |  | 0 |
Pass |  | cmp_int |  | test-priorityq.c |  | 0 |  | 0 |
FAIL |  | test_priorityq |  | test-priorityq.c |  | 1 | - |  | 10 | - |
FAIL |  | test_seq_range_array_random |  | test-seq-range-array.c |  | 1 | - |  | 6 | - |
FAIL |  | test_seq_range_array_invert |  | test-seq-range-array.c |  | 1 | - |  | 5 | - |
FAIL |  | test_seq_range_create |  | test-seq-range-array.c |  | 1 | - |  | 9 | - |
FAIL |  | test_seq_range_array_have_common |  | test-seq-range-array.c |  | 1 | - |  | 41 | - |
FAIL |  | test_seq_range_array |  | test-seq-range-array.c |  | 1 | - |  | 50 | - |
FAIL |  | test_str_find_substring |  | test-str-find.c |  | 1 | - |  | 6 | - |
FAIL |  | test_str_find |  | test-str-find.c |  | 1 | - |  | 21 | - |
FAIL |  | test_str_sanitize |  | test-str-sanitize.c |  | 1 | - |  | 4 | - |
FAIL |  | test_strescape |  | test-strescape.c |  | 1 | - |  | 14 | - |
FAIL |  | test_p_strarray_dup |  | test-strfuncs.c |  | 1 | - |  | 14 | - |
Pass |  | test_strfuncs |  | test-strfuncs.c |  | 0 |  | 0 |
Pass |  | test_timeval_cmp |  | test-time-util.c |  | 0 |  | 0 |
Pass |  | test_timeval_diff |  | test-time-util.c |  | 0 |  | 0 |
Pass |  | test_time_util |  | test-time-util.c |  | 0 |  | 0 |
FAIL |  | test_utc_mktime |  | test-utc-mktime.c |  | 1 | - |  | 13 | - |
FAIL |  | test_var_expand_builtin |  | test-var-expand.c |  | 1 | - |  | 40 | - |
Pass |  | test_var_expand |  | test-var-expand.c |  | 0 |  | 0 |
Pass |  | timeval_cmp |  | time-util.c |  | 0 |  | 0 |
Pass |  | timeval_diff_msecs |  | time-util.c |  | 0 |  | 0 |
Pass |  | timeval_diff_usecs |  | time-util.c |  | 0 |  | 0 |
Pass |  | uni_strlen |  | unichar.c |  | 0 |  | 0 |
Pass |  | uni_utf8_get_char |  | unichar.c |  | 0 |  | 0 |
FAIL |  | uni_utf8_get_char_n |  | unichar.c |  | 1 | - |  | 2 | - |
FAIL |  | uni_utf8_to_ucs4 |  | unichar.c |  | 1 | - |  | 25 | - |
Pass |  | uni_ucs4_to_utf8 |  | unichar.c |  | 0 |  | 0 |
FAIL |  | uni_ucs4_to_utf8_c |  | unichar.c |  | 1 | - |  | 8 | - |
Pass |  | uni_utf8_strlen_n |  | unichar.c |  | 0 |  | 0 |
Pass |  | uint16_find |  | unichar.c |  | 0 |  | 0 |
Pass |  | uint32_find |  | unichar.c |  | 0 |  | 0 |
FAIL |  | uni_ucs4_to_titlecase |  | unichar.c |  | 1 | - |  | 4 | - |
FAIL |  | uni_ucs4_decompose_uni |  | unichar.c |  | 1 | - |  | 3 | - |
FAIL |  | uni_ucs4_decompose_hangul_utf8 |  | unichar.c |  | 1 | - |  | 24 | - |
FAIL |  | uni_ucs4_decompose_multi_utf8 |  | unichar.c |  | 1 | - |  | 5 | - |
Pass |  | output_add_replacement_char |  | unichar.c |  | 0 |  | 0 |
FAIL |  | uni_utf8_to_decomposed_titlecase |  | unichar.c |  | 1 | - |  | 17 | - |
Pass |  | is_valid_utf8_seq |  | unichar.c |  | 0 |  | 0 |
Pass |  | uni_utf8_find_invalid_pos |  | unichar.c |  | 0 |  | 0 |
FAIL |  | uni_utf8_get_valid_data |  | unichar.c |  | 1 | - |  | 17 | - |
Pass |  | uni_utf8_str_is_valid |  | unichar.c |  | 0 |  | 0 |
FAIL |  | unix_socket_create |  | unix-socket-create.c |  | 1 | - |  | 18 | - |
FAIL |  | unlink_directory_r |  | unlink-directory.c |  | 1 | - |  | 1 | - |

`Quality Result` |  | `Procedure` |  | `Source File` |  | `Unique Violations` |  | `Failure Density` |
`` |  |  |  |  | `(Viols/R.Line %)` |
FAIL |  | unlink_directory |  | unlink-directory.c |  | 1 | - |  | 3 | - |
FAIL |  | unlink_old_files_real |  | unlink-old-files.c |  | 1 | - |  | 13 | - |
FAIL |  | unlink_old_files |  | unlink-old-files.c |  | 1 | - |  | 36 | - |
Pass |  | tm_cmp |  | utc-mktime.c |  | 0 |  | 0 |
FAIL |  | utc_mktime |  | utc-mktime.c |  | 1 | - |  | 2 | - |
Pass |  | utc_offset |  | utc-offset.c |  | 0 |  | 0 |
Pass |  | m_str_lcase |  | var-expand.c |  | 0 |  | 0 |
Pass |  | m_str_ucase |  | var-expand.c |  | 0 |  | 0 |
Pass |  | m_str_escape |  | var-expand.c |  | 0 |  | 0 |
Pass |  | m_str_hex |  | var-expand.c |  | 0 |  | 0 |
FAIL |  | m_str_reverse |  | var-expand.c |  | 1 | - |  | 13 | - |
FAIL |  | m_str_hash |  | var-expand.c |  | 1 | - |  | 25 | - |
Pass |  | m_str_md5 |  | var-expand.c |  | 0 |  | 0 |
FAIL |  | m_str_ldap_dn |  | var-expand.c |  | 1 | - |  | 19 | - |
Pass |  | m_str_trim |  | var-expand.c |  | 0 |  | 0 |
FAIL |  | var_expand_long |  | var-expand.c |  | 1 | - |  | 11 | - |
FAIL |  | var_expand |  | var-expand.c |  | 1 | - |  | 4 | - |
FAIL |  | var_get_key |  | var-expand.c |  | 1 | - |  | 2 | - |
Pass |  | var_has_long_key |  | var-expand.c |  | 0 |  | 0 |
FAIL |  | var_has_key |  | var-expand.c |  | 1 | - |  | 2 | - |
FAIL |  | var_expand_table_build |  | var-expand.c |  | 1 | - |  | 20 | - |
FAIL |  | wildcard_match_int |  | wildcard-match.c |  | 1 | - |  | 2 | - |
Pass |  | wildcard_match |  | wildcard-match.c |  | 0 |  | 0 |
Pass |  | wildcard_match_icase |  | wildcard-match.c |  | 0 |  | 0 |
FAIL |  | write_full |  | write-full.c |  | 1 | - |  | 3 | - |
FAIL |  | pwrite_full |  | write-full.c |  | 1 | - |  | 3 | - |

#### 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\file-dotlock.c | Tue Apr 06 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\write-full.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\wildcard-match.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\var-expand.c | Mon Apr 05 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\utc-offset.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\utc-mktime.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\unlink-old-files.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\unlink-directory.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\unix-socket-create.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\unicodemap.c | Fri Mar 26 07:18:12 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\unichar.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\time-util.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-var-expand.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-utc-mktime.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-time-util.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-strfuncs.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-strescape.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-str-sanitize.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-str-find.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-seq-range-array.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-priorityq.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-primes.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-network.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-mempool-alloconly.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-llist.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-lib.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-istream-tee.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-istream-seekable.c | Mon Apr 05 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-istream-crlf.c | Mon Apr 05 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-istream-concat.c | Mon Apr 05 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-hex-binary.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-crc32.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-buffer.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-bsearch-insert-pos.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-base64.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-array.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\test-aqueue.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\strnum.c | Wed May 19 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\strfuncs.c | Tue Apr 06 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\strescape.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\str.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\str-sanitize.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\str-find.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\sha2.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\sha1.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\seq-range-array.c | Mon Apr 19 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\sendfile-util.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\safe-mkstemp.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\safe-mkdir.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\safe-memset.c | Fri Mar 26 07:16:36 2010

Name | Last Modification Date
--- | ---
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\restrict-process-size.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\restrict-access.c | Wed May 12 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\read-full.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\randgen.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\process-title.c | Thu May 20 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\priorityq.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\printf-format-fix.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\primes.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ostream.c | Fri May 14 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ostream-file.c | Wed Jul 28 10:59:27 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ostream-buffer.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\nfs-workarounds.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\network.c | Thu Jun 17 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mountpoint.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\module-dir.c | Tue Apr 13 03:35:14 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mmap-util.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mmap-anon.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mkdir-parents.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool-unsafe-datastack.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool-system.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool-system-clean.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool-datastack.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\mempool-alloconly.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\md5.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\md4.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\lib.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\lib-signals.c | Tue Jun 01 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-tee.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-seekable.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-mmap.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-limit.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-file.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-data.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-crlf.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\istream-concat.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\iostream.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-select.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-poll.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-notify-none.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-notify-kqueue.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-notify-inotify.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-notify-fd.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-notify-dn.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-kqueue.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-iolist.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\ioloop-epoll.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\imem.c | Fri Mar 26 07:16:36 2010

Name | Last Modification Date
--- | ---
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hostpid.c | Tue May 25 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\home-expand.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hmac-md5.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hex-dec.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hex-binary.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hash2.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\hash.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\file-set-size.c | Fri May 14 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\file-lock.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\file-copy.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\file-cache.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\fdpass.c | Fri Mar 26 20:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\fdatasync-path.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\fd-set-nonblock.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\fd-close-on-exec.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\failures.c | Fri Jun 11 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\execv-const.c | Fri Mar 26 20:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\env-util.c | Mon Apr 05 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\eacces-error.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\data-stack.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\crc32.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\compat.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\close-keep-errno.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\child-wait.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\buffer.c | Fri Jun 18 19:00:04 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\bsearch-insert-pos.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\base64.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\backtrace-string.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\askpass.c | Sun Apr 04 19:00:06 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\array.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\aqueue.c | Fri Mar 26 07:16:36 2010
C:\Code\SAMATE\SATE2010\dovecot-2.0.beta6.20100626\dovecot-2.0.beta6\src\lib\abspath.c | Fri Mar 26 20:00:04 2010

#### Global Basic Information

Number of procedures: | 956
Number of locally uncalled procedures: | 0
Maximum loop depth: | 3
Total Cyclomatic Complexity: | 3248
Number of reformatted executable lines: | 34553
Number of lines of comments: | 74772

## 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
    Source: #define i_isalnum(x) isalnum((int) (unsigned char) (x))
M | compat.h: 215 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isalpha(x) isalpha((int) (unsigned char) (x))
M | compat.h: 216 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isascii(x) isascii((int) (unsigned char) (x))
M | compat.h: 217 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isblank(x) isblank((int) (unsigned char) (x))
M | compat.h: 218 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_iscntrl(x) iscntrl((int) (unsigned char) (x))
M | compat.h: 219 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isdigit(x) isdigit((int) (unsigned char) (x))
M | compat.h: 220 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isgraph(x) isgraph((int) (unsigned char) (x))
M | compat.h: 221 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_islower(x) islower((int) (unsigned char) (x))
M | compat.h: 222 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isprint(x) isprint((int) (unsigned char) (x))
M | compat.h: 223 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_ispunct(x) ispunct((int) (unsigned char) (x))
M | compat.h: 224 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isspace(x) isspace((int) (unsigned char) (x))
M | compat.h: 225 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isupper(x) isupper((int) (unsigned char) (x))
M | compat.h: 226 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_isxdigit(x) isxdigit((int) (unsigned char) (x))
M | macros.h: 196 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define COMPILE_ERROR_IF_TRUE(condition) 0
M | macros.h: 197 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE(_a, _b) 0
M | macros.h: 204 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define unlikely(expr) expr
M | macros.h: 204 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define unlikely(expr) expr
M | macros.h: 205 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define likely(expr) expr
M | macros.h: 205 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define likely(expr) expr
M | macros.h: 223 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define i_assert(expr)			STMT_START{		\
M | macros.h: 223 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_assert(expr)			STMT_START{		\
M | macros.h: 232 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_unreached() \
M | data-stack.h: 49 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define T_BEGIN \
M | data-stack.h: 51 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define T_END \
M | data-stack.h: 75 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define t_new(type, count) \

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | data-stack.h: 85 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define t_buffer_get_type(type, size) \
M | data-stack.h: 90 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define t_buffer_reget_type(buffer, type, size) \
M | data-stack.h: 90 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define t_buffer_reget_type(buffer, type, size) \
M | data-stack.h: 97 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define t_buffer_alloc_type(type, size) \
M | mempool.h: 84 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define p_new(pool, type, count) \
M | mempool.h: 87 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define p_malloc(pool, size) (pool)->v->malloc(pool, size)
M | mempool.h: 88 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define p_realloc(pool, mem, old_size, new_size) \
M | mempool.h: 99 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: } STMT_END
M | mempool.h: 99 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: } STMT_END
M | mempool.h: 102 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define p_free_and_null(pool, mem) p_free(pool, mem)
M | mempool.h: 102 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define p_free_and_null(pool, mem) p_free(pool, mem)
M | imem.h: 8 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define i_new(type, count) p_new(default_pool, type, count)
M | imem.h: 8 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_new(type, count) p_new(default_pool, type, count)
M | imem.h: 14 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define i_free(mem) p_free(default_pool, mem)
M | imem.h: 14 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_free(mem) p_free(default_pool, mem)
M | imem.h: 15 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define i_free_and_null(mem) p_free_and_null(default_pool, mem)
M | imem.h: 15 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_free_and_null(mem) p_free_and_null(default_pool, mem)
M | array-decl.h: 4 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array
M | array-decl.h: 4 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array
M | array-decl.h: 7 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define ARRAY_DEFINE_TYPE(name, array_type) \
M | array-decl.h: 7 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define ARRAY_DEFINE_TYPE(name, array_type) \
M | array-decl.h: 9 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define ARRAY_TYPE(name) \
M | array-decl.h: 9 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define ARRAY_TYPE(name) \
M | array.h: 35 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define p_array_init(array, pool, init_count) \
M | array.h: 35 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define p_array_init(array, pool, init_count) \

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | array.h: 37 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define i_array_init(array, init_count) \
M | array.h: 37 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define i_array_init(array, init_count) \
M | array.h: 39 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define t_array_init(array, init_count) \
M | array.h: 39 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define t_array_init(array, init_count) \
M | array.h: 53 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define ARRAY_TYPE_CHECK(array, data) 0
M | array.h: 58 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define array_foreach(array, elem) \
M | array.h: 58 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define array_foreach(array, elem) \
M | array.h: 62 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define array_foreach_modifiable(array, elem) \
M | array.h: 62 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define array_foreach_modifiable(array, elem) \
M | array.h: 90 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_create_from_buffer(array, buffer, element_size) \
M | array.h: 90 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_create_from_buffer(array, buffer, element_size) \
M | array.h: 102 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_create(array, pool, element_size, init_count) \
M | array.h: 102 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_create(array, pool, element_size, init_count) \
M | array.h: 110 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_free(array) \
M | array.h: 118 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_is_created(array) \
M | array.h: 126 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_get_pool(array) \
M | array.h: 134 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_clear(array) \
M | array.h: 143 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_append(array, data, count) \
M | array.h: 143 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_append(array, data, count) \
M | array.h: 153 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_append_array(dest_array, src_array) \
M | array.h: 164 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_insert(array, idx, data, count) \
M | array.h: 164 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_insert(array, idx, data, count) \
M | array.h: 174 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_delete(array, idx, count) \
M | array.h: 174 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_delete(array, idx, count) \
M | array.h: 183 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_get(array, count) \

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | array.h: 183 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_get(array, count) \
M | array.h: 192 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_idx(array, idx) \
M | array.h: 192 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_idx(array, idx) \
M | array.h: 201 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_get_modifiable(array, count) \
M | array.h: 201 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_get_modifiable(array, count) \
M | array.h: 206 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_idx_modifiable(array, idx) \
M | array.h: 206 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_idx_modifiable(array, idx) \
M | array.h: 211 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_idx_set(array, idx, data) \
M | array.h: 211 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_idx_set(array, idx, data) \
M | array.h: 216 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_idx_clear(array, idx) \
M | array.h: 216 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_idx_clear(array, idx) \
M | array.h: 228 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_append_space(array) \
M | array.h: 232 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_insert_space(array, idx) \
M | array.h: 232 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_insert_space(array, idx) \
M | array.h: 252 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_count(array) \
M | array.h: 257 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_cmp(array1, array2) \
M | array.h: 261 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_reverse(array) \
M | array.h: 266 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_sort(array, cmp) \
M | array.h: 279 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_bsearch(array, key, cmp) \
M | array.h: 279 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define array_bsearch(array, key, cmp) \
M | bsearch-insert-pos.h: 5 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define BINARY_NUMBER_SEARCH(data, count, value, idx_r) \
M | bsearch-insert-pos.h: 34 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define array_bsearch_insert_pos(array, key, cmp, idx_r) \
M | child-wait.h: 18 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define child_wait_new_with_pid(pid, callback, context) \
M | child-wait.h: 26 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define child_wait_new(callback, context) \
M | child-wait.h: 26 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define child_wait_new(callback, context) \

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | child-wait.c: 17 | Global not initialised at declaration. : child_pids | CERT EXP33-C
    Source: struct hash_table *child_pids;
M | data-stack.c: 59 | Global not initialised at declaration. : current_frame_block | CERT EXP33-C
    Source: static struct stack_frame_block *current_frame_block;
M | data-stack.c: 60 | Global not initialised at declaration. : unused_frame_blocks | CERT EXP33-C
    Source: static struct stack_frame_block *unused_frame_blocks;
M | data-stack.c: 62 | Global not initialised at declaration. : current_block | CERT EXP33-C
    Source: static struct stack_block *current_block; /* block now used for allocation */
M | data-stack.c: 63 | Global not initialised at declaration. : unused_block | CERT EXP33-C
    Source: static struct stack_block *unused_block; /* largest unused block is kept here */
M | data-stack.c: 65 | Global not initialised at declaration. : last_buffer_block | CERT EXP33-C
    Source: static struct stack_block *last_buffer_block;
M | data-stack.c: 66 | Global not initialised at declaration. : last_buffer_size | CERT EXP33-C
    Source: static size_t last_buffer_size;
M | data-stack.c: 73 | Global not initialised at declaration. : outofmem_area | CERT EXP33-C
    Source: } outofmem_area;
M | ioloop.h: 50 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define io_add(fd, condition, callback, context) \
M | ioloop.h: 50 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define io_add(fd, condition, callback, context) \
M | ioloop.h: 56 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define io_add_notify(path, callback, context, io_r) \
M | ioloop.h: 75 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: callback, context, msecs)
M | ioloop.h: 75 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: callback, context, msecs)
M | failures.c: 26 | Declaration types do not match across a system. : failure_log_type_prefixes | CERT ARR31-C
| 41 (failures.h) |  |
    Source: extern const char *failure_log_type_prefixes[];
    Source: };
M | ioloop.c: 15 | Global not initialised at declaration. : ioloop_timeval | CERT EXP33-C
    Source: struct timeval ioloop_timeval;
M | fdpass.c: 77 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: (((len) + align - 1) & ~(align - 1))
M | fdpass.c: 88 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define CMSG_SPACE(len) \
M | istream.h: 53 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: callback, context, stream)
M | istream.h: 53 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: callback, context, stream)
M | ostream.h: 61 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define o_stream_set_flush_callback(stream, callback, context) \
M | ostream.h: 61 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define o_stream_set_flush_callback(stream, callback, context) \
M | hex-dec.h: 5 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: dec2hex(hexstr, str, sizeof(hexstr))
M | hex-dec.h: 5 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: dec2hex(hexstr, str, sizeof(hexstr))
M | lib-signals.c: 17 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #  define SI_NOINFO -1

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | lib-signals.c: 37 | Global not initialised at declaration. : pending_signals | CERT EXP33-C
    Source: static siginfo_t pending_signals[MAX_SIGNAL_VALUE+1];
M | md4.c: 32 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define STEP(f, a, b, c, d, x, s) \
M | md4.c: 32 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define STEP(f, a, b, c, d, x, s) \
M | md5.c: 36 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define STEP(f, a, b, c, d, x, t, s) \
M | md5.c: 36 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define STEP(f, a, b, c, d, x, t, s) \
M | network.c: 25 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #  define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ? \
M | process-title.c: 19 | Global not initialised at declaration. : process_title | CERT EXP33-C
    Source: static char *process_title;
M | process-title.c: 20 | Global not initialised at declaration. : process_title_len | CERT EXP33-C
    Source: static size_t process_title_len, process_title_clean_pos;
M | process-title.c: 20 | Global not initialised at declaration. : process_title_clean_pos | CERT EXP33-C
    Source: static size_t process_title_len, process_title_clean_pos;
M | process-title.c: 21 | Global not initialised at declaration. : argv_memblock | CERT EXP33-C
    Source: static void *argv_memblock, *environ_memblock;
M | process-title.c: 21 | Global not initialised at declaration. : environ_memblock | CERT EXP33-C
    Source: static void *argv_memblock, *environ_memblock;
M | randgen.c: 15 | Global not initialised at declaration. : urandom_fd | CERT EXP33-C
    Source: static int urandom_fd;
M | sha1.h: 71 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define SHA1Init(x)		sha1_init((x))
M | sha1.h: 72 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define SHA1Update(x, y, z)	sha1_loop((x), (y), (z))
M | sha1.h: 73 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define SHA1Final(x, y)		sha1_result((y), (x))
M | sha1.c: 43 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define	K(t)	SHA1_K[(t) / 20]
M | sha1.c: 50 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define	S(n, x)		(((x) << (n)) | ((x) >> (32 - n)))
M | sha1.c: 57 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define	PUTBYTE(x)	{ \
M | sha1.c: 66 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define	PUTPAD(x)	{ \
M | sha2.c: 37 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHFR(x, n)    (x >> n)
M | sha2.c: 38 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define ROTR(x, n)   ((x >> n) | (x << ((sizeof(x) << 3) - n)))
M | sha2.c: 39 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define ROTL(x, n)   ((x << n) | (x >> ((sizeof(x) << 3) - n)))
M | sha2.c: 40 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define CH(x, y, z)  ((x & y) ^ (~x & z))
M | sha2.c: 41 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
M | sha2.c: 43 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA256_F1(x) (ROTR(x,  2) ^ ROTR(x, 13) ^ ROTR(x, 22))

Code | File: Src Line | Violation | Standard
--- | --- | --- | ---
M | sha2.c: 44 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA256_F2(x) (ROTR(x,  6) ^ ROTR(x, 11) ^ ROTR(x, 25))
M | sha2.c: 45 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA256_F3(x) (ROTR(x,  7) ^ ROTR(x, 18) ^ SHFR(x,  3))
M | sha2.c: 46 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA256_F4(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHFR(x, 10))
M | sha2.c: 48 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA512_F1(x) (ROTR(x, 28) ^ ROTR(x, 34) ^ ROTR(x, 39))
M | sha2.c: 49 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA512_F2(x) (ROTR(x, 14) ^ ROTR(x, 18) ^ ROTR(x, 41))
M | sha2.c: 50 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA512_F3(x) (ROTR(x,  1) ^ ROTR(x,  8) ^ SHFR(x,  7))
M | sha2.c: 51 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA512_F4(x) (ROTR(x, 19) ^ ROTR(x, 61) ^ SHFR(x,  6))
M | sha2.c: 53 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define UNPACK32(x, str)                      \
M | sha2.c: 61 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define PACK32(str, x)                        \
M | sha2.c: 69 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define UNPACK64(x, str)                      \
M | sha2.c: 81 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define PACK64(str, x)                        \
M | sha2.c: 93 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA256_SCR(i)                         \
M | sha2.c: 93 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define SHA256_SCR(i)                         \
M | sha2.c: 99 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define SHA512_SCR(i)                         \
M | sha2.c: 99 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define SHA512_SCR(i)                         \
M | test-common.h: 11 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define test_assert(code) STMT_START { \
M | test-common.h: 11 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define test_assert(code) STMT_START { \
M | llist.h: 5 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define DLLIST_PREPEND(list, item) STMT_START { \
M | llist.h: 12 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define DLLIST_REMOVE(list, item) STMT_START { \
M | llist.h: 25 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define DLLIST2_PREPEND(head, tail, item) STMT_START { \
M | llist.h: 25 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define DLLIST2_PREPEND(head, tail, item) STMT_START { \
M | llist.h: 32 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define DLLIST2_APPEND(head, tail, item) STMT_START { \
M | llist.h: 32 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define DLLIST2_APPEND(head, tail, item) STMT_START { \
M | llist.h: 39 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define DLLIST2_REMOVE(head, tail, item) STMT_START { \

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

t_abspath (10 to 20 abspath.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 19 | Pointer not checked for null before use : dir | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: if (t_get_current_dir(&dir) < 0)
    Source: return t_strconcat(dir, "/", path, NULL);
M | 18 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: if (t_get_current_dir(&dir) < 0)
    Source: i_fatal("getcwd() failed: %m");
M | 19 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("getcwd() failed: %m");
    Source: return t_strconcat(dir, "/", path, NULL);
M | 18 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: if (t_get_current_dir(&dir) < 0)
    Source: i_fatal("getcwd() failed: %m");
M | 19 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("getcwd() failed: %m");
    Source: return t_strconcat(dir, "/", path, NULL);
M | 12 | Procedure contains UR data flow anomalies. : dir | CERT EXP33-C
| 19 |  |
    Source: return t_strconcat(dir, "/", path, NULL);
    Source: const char *dir;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
abspath.c | 12 | abspath.c | 19 | dir
    Source: const char *dir;
    Source: return t_strconcat(dir, "/", path, NULL);

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

t_get_current_dir (30 to 46 abspath.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: size = nearest_power(size+1);
    Source: dir = t_buffer_get(size);
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: size = nearest_power(size+1);
    Source: dir = t_buffer_get(size);
M | 43 | Pointer not checked for null before use : dir | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: while (getcwd(dir, size) == NULL) {
    Source: t_buffer_alloc(strlen(dir) + 1);
M | 43 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: dir = t_buffer_get(size);
    Source: t_buffer_alloc(strlen(dir) + 1);
M | 43 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: dir = t_buffer_get(size);
    Source: t_buffer_alloc(strlen(dir) + 1);

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

t_readlink (48 to 67 abspath.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 58 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 57 |  |
    Source: size = nearest_power(size+1);
    Source: dest = t_buffer_get(size);
M | 58 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 57 |  |
    Source: size = nearest_power(size+1);
    Source: dest = t_buffer_get(size);
M | 56 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: dest = t_buffer_get(size);
    Source: while ((ret = readlink(path, dest, size)) >= (ssize_t)size) {
M | 57 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: dest = t_buffer_get(size);
    Source: size = nearest_power(size+1);
M | 64 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: dest = t_buffer_get(size);
    Source: t_buffer_alloc(ret + 1);
M | 57 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: dest = t_buffer_get(size);
    Source: size = nearest_power(size+1);
M | 64 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: dest = t_buffer_get(size);
    Source: t_buffer_alloc(ret + 1);

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

t_binary_abspath (69 to 97 abspath.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 84 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 83 |  |
    Source: path = t_str_new(256);
    Source: paths = t_strsplit(path_env, ":");
M | 84 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 83 |  |
    Source: path = t_str_new(256);
    Source: paths = t_strsplit(path_env, ":");
M | 87 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_append(path, *paths);
    Source: str_append_c(path, '/');
M | 87 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_append(path, *paths);
    Source: str_append_c(path, '/');
M | 88 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: str_append_c(path, '/');
    Source: str_append(path, *binpath);
M | 88 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: str_append_c(path, '/');
    Source: str_append(path, *binpath);
M | 89 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: str_append(path, *binpath);
    Source: if (access(str_c(path), X_OK) == 0) {
M | 89 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: str_append(path, *binpath);
    Source: if (access(str_c(path), X_OK) == 0) {
M | 85 | Pointer not checked for null before use : paths | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: paths = t_strsplit(path_env, ":");
    Source: for (; *paths != NULL; paths++) {
M | 86 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 83 |  |
    Source: path = t_str_new(256);
    Source: str_append(path, *paths);
M | 90 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: if (access(str_c(path), X_OK) == 0) {
    Source: *binpath = str_c(path);
M | 93 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: if (access(str_c(path), X_OK) == 0) {
    Source: str_truncate(path, 0);
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 84 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: paths = t_strsplit(path_env, ":");
    Source: str_append(path, *paths);
M | 90 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: if (access(str_c(path), X_OK) == 0) {
    Source: *binpath = str_c(path);
M | 93 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: if (access(str_c(path), X_OK) == 0) {
    Source: str_truncate(path, 0);
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: paths = t_strsplit(path_env, ":");
    Source: str_append(path, *paths);

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

array_create_i (93 to 101 array.h analysed in aqueue.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 |  |
    Source: buffer = buffer_create_dynamic(pool, init_count * element_size);
    Source: array_create_from_buffer_i(array, buffer, element_size);

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

array_append_array_i (147 to 152 array.h analysed in aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 151 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 150 |  |
    Source: i_assert(dest_array->element_size == src_array->element_size);
    Source: buffer_append_buf(dest_array->buffer, src_array->buffer, 0, (size_t)-1);
M | 151 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 150 |  |
    Source: i_assert(dest_array->element_size == src_array->element_size);
    Source: buffer_append_buf(dest_array->buffer, src_array->buffer, 0, (size_t)-1);

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

array_get_modifiable_i (195 to 200 array.h analysed in aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 199 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return buffer_get_modifiable_data(array->buffer, NULL);

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

array_copy (236 to 245 array.h analysed in aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 242 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: i_assert(dest->element_size == src->element_size);
    Source: buffer_copy(dest->buffer, dest_idx * dest->element_size,
M | 242 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: i_assert(dest->element_size == src->element_size);
    Source: buffer_copy(dest->buffer, dest_idx * dest->element_size,

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

aqueue_init (7 to 17 aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 16 | Local structure returned in function result : aqueue |
    Source: return aqueue;
M | 12 | Pointer not checked for null before use : aqueue | CERT EXP08-C,EXP34-C
| 11 |  |
    Source: aqueue = i_new(struct aqueue, 1);
    Source: aqueue->arr = array;
M | 11 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 624) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\AQUEUE_624.ref" looking for line -1105
    Source: aqueue = i_new(struct aqueue, 1);

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

aqueue_deinit (19 to 25 aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 24 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 624) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\AQUEUE_624.ref" looking for line -1105
    Source: i_free(aqueue);

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

aqueue_grow (27 to 51 aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: i_assert(aqueue->full && aqueue->head == aqueue->tail);
    Source: (void)array_append_space_i(aqueue->arr);
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: (void)array_append_space_i(aqueue->arr);
    Source: i_assert(orig_area_size < aqueue->area_size);
M | 44 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: array_copy(aqueue->arr, orig_area_size, aqueue->arr, 0, count);
    Source: array_copy(aqueue->arr, 0, aqueue->arr, count,
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: array_copy(aqueue->arr, 0, aqueue->arr, count,
    Source: i_assert(aqueue->head != aqueue->tail);
M | 40 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_assert(orig_area_size < aqueue->area_size);
    Source: array_copy(aqueue->arr, orig_area_size, aqueue->arr, 0, count);
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: i_assert(aqueue->full && aqueue->head == aqueue->tail);
    Source: (void)array_append_space_i(aqueue->arr);
M | 37 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: (void)array_append_space_i(aqueue->arr);
    Source: i_assert(orig_area_size < aqueue->area_size);
M | 44 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: array_copy(aqueue->arr, orig_area_size, aqueue->arr, 0, count);
    Source: array_copy(aqueue->arr, 0, aqueue->arr, count,
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: array_copy(aqueue->arr, 0, aqueue->arr, count,
    Source: i_assert(aqueue->head != aqueue->tail);
M | 40 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_assert(orig_area_size < aqueue->area_size);
    Source: array_copy(aqueue->arr, orig_area_size, aqueue->arr, 0, count);

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

aqueue_append (53 to 63 aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 57 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: aqueue_grow(aqueue);
    Source: i_assert(!aqueue->full);
M | 57 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: aqueue_grow(aqueue);
    Source: i_assert(!aqueue->full);

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

aqueue_delete (65 to 105 aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 92 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: array_copy(aqueue->arr, aqueue->tail + 1,
    Source: i_assert(aqueue->tail < aqueue->area_size);
M | 97 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: i_assert(idx < aqueue->head);
    Source: array_copy(aqueue->arr, idx,
M | 103 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: array_copy(aqueue->arr, idx,
    Source: i_assert(aqueue->head < aqueue->area_size &&
M | 88 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 69 |  |
    Source: i_assert(n < count);
    Source: array_copy(aqueue->arr, aqueue->tail + 1,
M | 92 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: array_copy(aqueue->arr, aqueue->tail + 1,
    Source: i_assert(aqueue->tail < aqueue->area_size);
M | 97 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: i_assert(idx < aqueue->head);
    Source: array_copy(aqueue->arr, idx,
M | 103 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: array_copy(aqueue->arr, idx,
    Source: i_assert(aqueue->head < aqueue->area_size &&
M | 88 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 69 |  |
    Source: i_assert(n < count);
    Source: array_copy(aqueue->arr, aqueue->tail + 1,

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

array_idx_modifiable_i (8 to 19 array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 18 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 15 |  |
    Source: buffer_append_zero(array->buffer, pos + array->element_size -
    Source: return buffer_get_space_unsafe(array->buffer, pos, array->element_size);
M | 18 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 15 |  |
    Source: buffer_append_zero(array->buffer, pos + array->element_size -
    Source: return buffer_get_space_unsafe(array->buffer, pos, array->element_size);

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

array_idx_set_i (21 to 31 array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: buffer_append_zero(array->buffer, pos - array->buffer->used);
    Source: buffer_write(array->buffer, pos, data, array->element_size);
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: buffer_append_zero(array->buffer, pos - array->buffer->used);
    Source: buffer_write(array->buffer, pos, data, array->element_size);

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

array_insert_space_i (47 to 59 array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: buffer_copy(array->buffer, pos + array->element_size,
    Source: data = buffer_get_space_unsafe(array->buffer, pos, array->element_size);
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: buffer_copy(array->buffer, pos + array->element_size,
    Source: data = buffer_get_space_unsafe(array->buffer, pos, array->element_size);

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

array_reverse_i (72 to 89 array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 86 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 82 |  |
    Source: memcpy(tmp, PTR_OFFSET(data, i * element_size), element_size);
    Source: memcpy(PTR_OFFSET(data, (count-1) * element_size), tmp,
M | 82 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: data = buffer_get_modifiable_data(array->buffer, &size);
    Source: memcpy(tmp, PTR_OFFSET(data, i * element_size), element_size);
M | 76 | Procedure contains UR data flow anomalies. : size | CERT EXP33-C
| 79 |  |
    Source: data = buffer_get_modifiable_data(array->buffer, &size);
    Source: size_t size;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
array.c | 76 | array.c | 79 | size
    Source: size_t size;
    Source: data = buffer_get_modifiable_data(array->buffer, &size);

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

array_sort_i (91 to 98 array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 96 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: qsort(buffer_get_modifiable_data(array->buffer, NULL),

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

askpass (11 to 53 askpass.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 44 | User input not checked before use. : ch | CERT FIO30-C
| 39 |  |
    Source: while (read(fd, &ch, 1) > 0) {
    Source: buf[pos++] = ch;
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: i_fatal("stdin isn't a TTY");
    Source: i_fatal("open(/dev/tty) failed: %m");
M | 27 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: i_fatal("stdin isn't a TTY");
    Source: i_fatal("open(/dev/tty) failed: %m");
M | 13 | Procedure contains UR data flow anomalies. : old_tio | CERT EXP33-C
| 30 |  |
    Source: if (tcgetattr(fd, &old_tio) == 0) {
    Source: struct termios old_tio, tio;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
askpass.c | 13 | askpass.c | 30 | old_tio
    Source: struct termios old_tio, tio;
    Source: if (tcgetattr(fd, &old_tio) == 0) {

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

backtrace_append (15 to 39 backtrace-string.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: ret = backtrace(stack, N_ELEMENTS(stack));
M | 37 | free parameter is not heap item. | CERT MEM34-C
    Source: free(strings);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: str_append(str, " -> ");
    Source: str_printfa(str, "0x%p", stack[i]);
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: str_printfa(str, "0x%p", stack[i]);
    Source: str_append(str, " -> ");
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: str_append(str, " -> ");
    Source: str_printfa(str, "0x%p", stack[i]);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: str_printfa(str, "0x%p", stack[i]);
    Source: str_append(str, " -> ");
M | 17 | Procedure contains UR data flow anomalies. : stack | CERT EXP33-C
| 21 |  |
    Source: ret = backtrace(stack, N_ELEMENTS(stack));
    Source: void *stack[MAX_STACK_SIZE];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
backtrace-string.c | 17 | backtrace-string.c | 21 | stack
    Source: void *stack[MAX_STACK_SIZE];
    Source: ret = backtrace(stack, N_ELEMENTS(stack));

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

backtrace_get (83 to 93 backtrace-string.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 88 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: str = t_str_new(512);
    Source: if (backtrace_append(str) < 0)
M | 88 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: str = t_str_new(512);
    Source: if (backtrace_append(str) < 0)
M | 91 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: if (backtrace_append(str) < 0)
    Source: *backtrace_r = str_c(str);
M | 91 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: if (backtrace_append(str) < 0)
    Source: *backtrace_r = str_c(str);

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

t_base64_decode_str (152 to 161 base64.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 159 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: buf = buffer_create_dynamic(pool_datastack_create(),
    Source: (void)base64_decode(str, len, NULL, buf);
M | 159 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: buf = buffer_create_dynamic(pool_datastack_create(),
    Source: (void)base64_decode(str, len, NULL, buf);
M | 159 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: (void)base64_decode(str, len, NULL, buf);
M | 159 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: buf = buffer_create_dynamic(pool_datastack_create(),
    Source: (void)base64_decode(str, len, NULL, buf);

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

bsearch_insert_pos (7 to 36 bsearch-insert-pos.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 20 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: p = CONST_PTR_OFFSET(base, idx * size);
    Source: ret = cmp(key, p);

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

buffer_alloc (23 to 37 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: i_assert(buf->w_buffer == NULL || buf->alloced);
    Source: i_assert(size > buf->alloc);
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: i_assert(buf->w_buffer == NULL || buf->alloced);
    Source: i_assert(size > buf->alloc);

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

buffer_check_limits (39 to 86 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
M | 63 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_panic("Buffer full (%"PRIuSIZE_T" > %"PRIuSIZE_T", "
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
M | 85 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
    Source: i_assert(buf->used <= buf->alloc);
M | 63 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_panic("Buffer full (%"PRIuSIZE_T" > %"PRIuSIZE_T", "
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
M | 85 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: buffer_alloc(buf, pool_get_exp_grown_size(buf->pool, buf->alloc,
    Source: i_assert(buf->used <= buf->alloc);

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

buffer_create_data (88 to 98 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 95 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: buf = (struct real_buffer *)buffer;
    Source: memset(buf, 0, sizeof(*buf));
M | 96 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: memset(buf, 0, sizeof(*buf));
    Source: buf->alloc = size;

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

buffer_create_const_data (100 to 112 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 107 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 106 |  |
    Source: buf = (struct real_buffer *)buffer;
    Source: memset(buf, 0, sizeof(*buf));
M | 109 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: memset(buf, 0, sizeof(*buf));
    Source: buf->used = buf->alloc = size;
M | 111 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: i_assert(sizeof(*buffer) >= sizeof(struct real_buffer));
    Source: i_assert(buf->w_buffer == NULL);
M | 111 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: i_assert(sizeof(*buffer) >= sizeof(struct real_buffer));
    Source: i_assert(buf->w_buffer == NULL);

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

buffer_create_dynamic (114 to 123 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 122 | Local structure returned in function result : buf |
    Source: return (buffer_t *)buf;
M | 119 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: buf = p_new(pool, struct real_buffer, 1);
    Source: buf->pool = pool;

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

buffer_free (125 to 134 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 133 | Attempt to read from freed memory. : *((buf)->pool) | CERT MEM30-C
    Source: p_free(buf->pool, buf);

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

buffer_free_without_data (136 to 146 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 144 | Pointer not checked for null before use : *((buf)->pool) | CERT EXP08-C,EXP34-C
| Ref. Line 0 (Module 630) |  |
    Ref(0):Line 0 in C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\BUFFER_630.ref
    Source: p_free(buf->pool, buf);

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

buffer_copy (239 to 260 buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 252 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 246 |  |
    Source: i_assert(src_pos <= src->used);
    Source: buffer_check_limits(dest, dest_pos, copy_size);
M | 252 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 246 |  |
    Source: i_assert(src_pos <= src->used);
    Source: buffer_check_limits(dest, dest_pos, copy_size);

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

child_wait_new_with_pid (20 to 33 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 32 | Local structure returned in function result : wait |
    Source: return wait;
M | 27 | Pointer not checked for null before use : wait | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: wait = i_new(struct child_wait, 1);
    Source: wait->callback = callback;
M | 26 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 631) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\CHILD-WAIT_631.ref" looking for line -1105
    Source: wait = i_new(struct child_wait, 1);

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

child_wait_free (35 to 57 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 48 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: while (hash_table_iterate(iter, &key, &value)) {
    Source: hash_table_remove(child_pids, key);
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: hash_table_iterate_deinit(&iter);
    Source: i_free(wait);
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: hash_table_remove(child_pids, key);
    Source: hash_table_iterate_deinit(&iter);
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: hash_table_remove(child_pids, key);
    Source: hash_table_iterate_deinit(&iter);

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

child_wait_add_pid (59 to 63 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 62 | Pointer not checked for null before use : child_pids | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: struct hash_table *child_pids;
    Source: hash_table_insert(child_pids, POINTER_CAST(pid), wait);

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

child_wait_remove_pid (65 to 69 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 68 | Pointer not checked for null before use : child_pids | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: struct hash_table *child_pids;
    Source: hash_table_remove(child_pids, POINTER_CAST(pid));

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

sigchld_handler (71 to 87 child-wait.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 79 | Attempt to use already freed object. | CERT MEM31-C
    Source: if (status.wait != NULL) {
M | 80 | Attempt to use already freed object. | CERT MEM31-C
    Source: child_wait_remove_pid(status.wait, status.pid);
M | 81 | Attempt to use already freed object. | CERT MEM31-C
    Source: status.wait->callback(&status, status.wait->context);
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: child_wait_remove_pid(status.wait, status.pid);
    Source: i_error("waitpid() failed: %m");
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: child_wait_remove_pid(status.wait, status.pid);
    Source: i_error("waitpid() failed: %m");
M | 74 | Procedure contains UR data flow anomalies. : status.status | CERT EXP33-C
| 76 |  |
    Source: while ((status.pid = waitpid(-1, &status.status, WNOHANG)) > 0) {
    Source: struct child_wait_status status;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
child-wait.c | 74 | child-wait.c | 76 | status.status
    Source: struct child_wait_status status;
    Source: while ((status.pid = waitpid(-1, &status.status, WNOHANG)) > 0) {

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

child_wait_init (89 to 95 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 91 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: child_pids = hash_table_create(default_pool, default_pool, 0,
M | 94 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: lib_signals_set_handler(SIGCHLD, TRUE, sigchld_handler, NULL);
M | 91 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 631) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\CHILD-WAIT_631.ref" looking for line -1105
    Source: child_pids = hash_table_create(default_pool, default_pool, 0,

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

child_wait_deinit (97 to 110 child-wait.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 106 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(value);
M | 102 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
M | 104 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
    Source: iter = hash_table_iterate_init(child_pids);
M | 102 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 631) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\CHILD-WAIT_631.ref" looking for line -1105
    Source: lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
M | 104 | Pointer not checked for null before use : child_pids | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: struct hash_table *child_pids;
    Source: iter = hash_table_iterate_init(child_pids);
M | 106 | Pointer not checked for null before use : value | CERT EXP08-C,EXP34-C
| 105 |  |
    Source: while (hash_table_iterate(iter, &key, &value))
    Source: i_free(value);
M | 107 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 106 |  |
    Source: i_free(value);
    Source: hash_table_iterate_deinit(&iter);
M | 107 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: hash_table_iterate_deinit(&iter);
M | 107 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
    Source: hash_table_iterate_deinit(&iter);
M | 109 | Pointer not checked for null before use : child_pids.frozen | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: iter = hash_table_iterate_init(child_pids);
    Source: hash_table_destroy(&child_pids);
M | 106 | Attempt to read from freed memory. : value | CERT MEM30-C
    Source: i_free(value);

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

t_push (108 to 151 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 140 | Pointer not checked for null before use : frame_block | CERT EXP08-C,EXP34-C
| 136 |  |
    Source: frame_block = unused_frame_blocks;
    Source: frame_block->prev = current_frame_block;
M | 140 | Pointer not checked for null before use : unused_frame_blocks | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: unused_frame_blocks = unused_frame_blocks->prev;
    Source: frame_block->prev = current_frame_block;
M | 151 | Memory not freed after last reference. : frame_block | CERT MEM00-C
    Source: }
M | 146 | Pointer not checked for null before use : current_frame_block | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: current_frame_block = frame_block;
    Source: current_frame_block->block[frame_pos] = current_block;
M | 119 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: data_stack_init();
    Source: return t_push();
M | 119 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: data_stack_init();
    Source: return t_push();
M | 119 | Pointer not checked for null before use : last_buffer_block | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: data_stack_init();
    Source: return t_push();

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

free_blocks (153 to 179 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 177 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 160 |  |
    Source: next = block->next;
    Source: block = next;

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

t_pop (216 to 262 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 255 | Pointer not checked for null before use : frame_block | CERT EXP08-C,EXP34-C
| 254 |  |
    Source: frame_block = current_frame_block;
    Source: current_frame_block = frame_block->prev;
M | 257 | Pointer not checked for null before use : current_frame_block | CERT EXP08-C,EXP34-C
| 255 |  |
    Source: current_frame_block = frame_block->prev;
    Source: frame_block->prev = unused_frame_blocks;
M | 233 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: current_block = current_frame_block->block[frame_pos];
    Source: pos = current_block->size -
M | 239 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: current_block = current_frame_block->block[frame_pos];
    Source: current_block->left = current_frame_block->block_space_used[frame_pos];

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

t_pop_check (264 to 269 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 267 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 266 |  |
    Source: if (unlikely(t_pop() != *id))
    Source: i_panic("Leaked t_pop() call");
M | 267 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 266 |  |
    Source: if (unlikely(t_pop() != *id))
    Source: i_panic("Leaked t_pop() call");

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

mem_block_alloc (271 to 303 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 302 | Local structure returned in function result : block |
    Source: return block;
M | 276 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: static struct stack_block *current_block; /* block now used for allocation */
    Source: prev_size = current_block == NULL ? 0 : current_block->size;
M | 291 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 277 |  |
    Source: alloc_size = nearest_power(prev_size + min_size);
    Source: i_panic("data stack: Out of memory when allocating %"
M | 291 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 277 |  |
    Source: alloc_size = nearest_power(prev_size + min_size);
    Source: i_panic("data stack: Out of memory when allocating %"
M | 303 | Memory not freed after last reference. : block | CERT MEM00-C
    Source: }

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

t_malloc_real (305 to 387 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 358 | Pointer not checked for null before use : block | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: block = mem_block_alloc(alloc_size);
    Source: block->left = block->size;
M | 358 | Attempt to read from freed memory. : unused_block | CERT MEM30-C
    Source: block->left = block->size;
M | 352 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 315 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: block = mem_block_alloc(alloc_size);
M | 352 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 315 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: block = mem_block_alloc(alloc_size);
M | 358 | Pointer not checked for null before use : unused_block | CERT EXP08-C,EXP34-C
| 350 |  |
    Source: unused_block = NULL;
    Source: block->left = block->size;
M | 368 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 366 |  |
    Source: current_block = block;
    Source: ret = STACK_BLOCK_DATA(current_block);
M | 319 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 315 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: data_stack_init();
M | 319 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 315 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: data_stack_init();

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

t_buffer_get (441 to 450 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 445 | Pointer not checked for null before use : last_buffer_block | CERT EXP08-C,EXP34-C
| 65 |  |
    Source: static struct stack_block *last_buffer_block;
    Source: ret = t_malloc_real(size, FALSE);
M | 448 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: static struct stack_block *current_block; /* block now used for allocation */
    Source: last_buffer_block = current_block;

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

t_buffer_alloc (468 to 476 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 475 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 472 |  |
    Source: i_assert(current_block->left >= size);
    Source: t_malloc_real(size, TRUE);
M | 475 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 472 |  |
    Source: i_assert(current_block->left >= size);
    Source: t_malloc_real(size, TRUE);

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

data_stack_init (491 to 515 data-stack.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 514 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 502 |  |
    Source: current_block = mem_block_alloc(INITIAL_STACK_SIZE);
    Source: t_push();
M | 514 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 502 |  |
    Source: current_block = mem_block_alloc(INITIAL_STACK_SIZE);
    Source: t_push();
M | 514 | Pointer not checked for null before use : current_frame_block | CERT EXP08-C,EXP34-C
| 506 |  |
    Source: current_frame_block = NULL;
    Source: t_push();
M | 514 | Pointer not checked for null before use : unused_frame_blocks | CERT EXP08-C,EXP34-C
| 507 |  |
    Source: unused_frame_blocks = NULL;
    Source: t_push();
M | 514 | Pointer not checked for null before use : last_buffer_block | CERT EXP08-C,EXP34-C
| 510 |  |
    Source: last_buffer_block = NULL;
    Source: t_push();
M | 503 | Pointer not checked for null before use : current_block | CERT EXP08-C,EXP34-C
| 502 |  |
    Source: current_block = mem_block_alloc(INITIAL_STACK_SIZE);
    Source: current_block->left = current_block->size;
M | 510 | Procedure contains UR data flow anomalies. : last_buffer_block | CERT EXP33-C
| 65 |  |
    Source: static struct stack_block *last_buffer_block;
    Source: last_buffer_block = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
data-stack.c | 510 | data-stack.c | 514 | last_buffer_block
    Source: last_buffer_block = NULL;
    Source: t_push();

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

data_stack_deinit (517 to 538 data-stack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 519 | Pointer not checked for null before use : unused_block | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: static struct stack_block *unused_block; /* largest unused block is kept here */
    Source: t_pop();
M | 519 | Pointer not checked for null before use : unused_frame_blocks | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: static struct stack_frame_block *unused_frame_blocks;
    Source: t_pop();
M | 522 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 519 |  |
    Source: t_pop();
    Source: i_panic("Missing t_pop() call");
M | 522 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 519 |  |
    Source: t_pop();
    Source: i_panic("Missing t_pop() call");

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

test_access (30 to 82 eacces-error.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 72 | User input not checked before use. : st | CERT FIO30-C
| 66 |  |
    Source: if (stat(path, &st) < 0) {
    Source: st.st_mode = (st.st_mode & 0700) >> 6;
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_unreached();
    Source: str_printfa(errmsg, " stat(%s) failed: %m", path);
M | 54 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: if (stat(t_strconcat(path, "/test", NULL), &st) == 0)
    Source: str_printfa(errmsg, " stat(%s/test) failed: %m", path);
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_unreached();
    Source: else if (is_in_group(st.st_gid))
M | 67 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_unreached();
    Source: str_printfa(errmsg, " stat(%s) failed: %m", path);
M | 54 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: if (stat(t_strconcat(path, "/test", NULL), &st) == 0)
    Source: str_printfa(errmsg, " stat(%s/test) failed: %m", path);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_unreached();
    Source: else if (is_in_group(st.st_gid))

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

eacces_error_get_full (84 to 183 eacces-error.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 97 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s)", func, path);
M | 97 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s)", func, path);
M | 97 | Pointer not checked for null before use : errmsg | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s)", func, path);
M | 121 | Pointer not checked for null before use : dir | CERT EXP08-C,EXP34-C
| 120 |  |
    Source: dir = t_strdup_until(prev_path, p);
    Source: ret = stat(dir, &st);
M | 182 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 180 |  |
    Source: str_append_c(errmsg, ')');
    Source: return str_c(errmsg);
M | 182 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 180 |  |
    Source: str_append_c(errmsg, ')');
    Source: return str_c(errmsg);
M | 119 | Pointer not checked for null before use : prev_path | CERT EXP08-C,EXP34-C
| 134 |  |
    Source: prev_path = dir;
    Source: while ((p = strrchr(prev_path, '/')) != NULL) {
M | 136 | User input not checked before use. : st | CERT FIO30-C
| 121 |  |
    Source: ret = stat(dir, &st);
    Source: dir_st = st;
M | 99 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_printfa(errmsg, "%s(%s)", func, path);
    Source: if (t_get_current_dir(&dir) == 0)
M | 100 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 99 |  |
    Source: if (t_get_current_dir(&dir) == 0)
    Source: str_printfa(errmsg, " in directory %s", dir);
M | 102 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_printfa(errmsg, "%s(%s)", func, path);
    Source: str_printfa(errmsg, " failed: Permission denied (euid=%s",
M | 108 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: str_printfa(errmsg, " failed: Permission denied (euid=%s",
    Source: str_printfa(errmsg, "(%s)", pw_name);
M | 111 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 108 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: str_printfa(errmsg, "(%s)", pw_name);
    Source: str_printfa(errmsg, " egid=%s", dec2str(getegid()));
M | 115 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 111 |  |
    Source: str_printfa(errmsg, " egid=%s", dec2str(getegid()));
    Source: str_printfa(errmsg, "(%s)", gr_name);
M | 180 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 176 |  |
    Source: str_printfa(errmsg, ", conflicting dir gid=%s(%s)",
    Source: str_append_c(errmsg, ')');
M | 141 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: str_printfa(errmsg, " stat(%s) failed: %m", dir);
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
    Source: str_printfa(errmsg, " missing +x perm: %s", dir);
M | 144 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
    Source: } else if (creating && test_access(dir, W_OK, errmsg) < 0) {
M | 158 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 151 |  |
    Source: } else if (!creating && test_access(path, W_OK, errmsg) < 0) {
    Source: str_printfa(errmsg, " UNIX perms appear ok, "
M | 120 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: str_printfa(errmsg, "(%s)", gr_name);
    Source: dir = t_strdup_until(prev_path, p);
M | 148 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: } else if (creating && test_access(dir, W_OK, errmsg) < 0) {
    Source: test_access(path, R_OK, errmsg) < 0) {
M | 151 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: test_access(path, R_OK, errmsg) < 0) {
    Source: } else if (!creating && test_access(path, W_OK, errmsg) < 0) {
M | 131 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 120 |  |
    Source: dir = t_strdup_until(prev_path, p);
    Source: str_printfa(errmsg, " stat(%s) failed: %m", dir);
M | 171 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: str_printfa(errmsg, " missing +x perm: %s", dir);
    Source: str_append(errmsg, ", euid is dir owner");
M | 99 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_printfa(errmsg, "%s(%s)", func, path);
    Source: if (t_get_current_dir(&dir) == 0)

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 100 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 99 |  |
    Source: if (t_get_current_dir(&dir) == 0)
    Source: str_printfa(errmsg, " in directory %s", dir);
M | 102 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_printfa(errmsg, "%s(%s)", func, path);
    Source: str_printfa(errmsg, " failed: Permission denied (euid=%s",
M | 108 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: str_printfa(errmsg, " failed: Permission denied (euid=%s",
    Source: str_printfa(errmsg, "(%s)", pw_name);
M | 111 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: str_printfa(errmsg, "(%s)", pw_name);
    Source: str_printfa(errmsg, " egid=%s", dec2str(getegid()));
M | 115 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 111 |  |
    Source: str_printfa(errmsg, " egid=%s", dec2str(getegid()));
    Source: str_printfa(errmsg, "(%s)", gr_name);
M | 180 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 176 |  |
    Source: str_printfa(errmsg, ", conflicting dir gid=%s(%s)",
    Source: str_append_c(errmsg, ')');
M | 141 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: str_printfa(errmsg, " stat(%s) failed: %m", dir);
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
M | 143 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
    Source: str_printfa(errmsg, " missing +x perm: %s", dir);
M | 144 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: if (test_access(dir, X_OK, errmsg) < 0) {
    Source: } else if (creating && test_access(dir, W_OK, errmsg) < 0) {
M | 158 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 151 |  |
    Source: } else if (!creating && test_access(path, W_OK, errmsg) < 0) {
    Source: str_printfa(errmsg, " UNIX perms appear ok, "
M | 120 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: str_printfa(errmsg, "(%s)", gr_name);
    Source: dir = t_strdup_until(prev_path, p);
M | 148 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: } else if (creating && test_access(dir, W_OK, errmsg) < 0) {
    Source: test_access(path, R_OK, errmsg) < 0) {
M | 151 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 148 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: test_access(path, R_OK, errmsg) < 0) {
    Source: } else if (!creating && test_access(path, W_OK, errmsg) < 0) {
M | 131 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 120 |  |
    Source: dir = t_strdup_until(prev_path, p);
    Source: str_printfa(errmsg, " stat(%s) failed: %m", dir);
M | 171 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: str_printfa(errmsg, " missing +x perm: %s", dir);
    Source: str_append(errmsg, ", euid is dir owner");

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

eperm_error_get_chgrp (195 to 219 eacces-error.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 204 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s, -1, %s", func, path, dec2str(gid));
M | 204 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s, -1, %s", func, path, dec2str(gid));
M | 204 | Pointer not checked for null before use : errmsg | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: errmsg = t_str_new(256);
    Source: str_printfa(errmsg, "%s(%s, -1, %s", func, path, dec2str(gid));
M | 218 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 216 |  |
    Source: str_append_c(errmsg, ')');
    Source: return str_c(errmsg);
M | 218 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 216 |  |
    Source: str_append_c(errmsg, ')');
    Source: return str_c(errmsg);
M | 216 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 215 |  |
    Source: str_printfa(errmsg, ", group based on %s", gid_origin);
    Source: str_append_c(errmsg, ')');
M | 207 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 204 |  |
    Source: str_printfa(errmsg, "%s(%s, -1, %s", func, path, dec2str(gid));
    Source: str_printfa(errmsg, "(%s)", group->gr_name);
M | 209 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 207 |  |
    Source: str_printfa(errmsg, "(%s)", group->gr_name);
    Source: str_printfa(errmsg, ") failed: Operation not permitted (egid=%s",
M | 213 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 209 |  |
    Source: str_printfa(errmsg, ") failed: Operation not permitted (egid=%s",
    Source: str_printfa(errmsg, "(%s)", group->gr_name);
M | 216 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 215 |  |
    Source: str_printfa(errmsg, ", group based on %s", gid_origin);
    Source: str_append_c(errmsg, ')');
M | 207 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 204 |  |
    Source: str_printfa(errmsg, "%s(%s, -1, %s", func, path, dec2str(gid));
    Source: str_printfa(errmsg, "(%s)", group->gr_name);
M | 209 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 207 |  |
    Source: str_printfa(errmsg, "(%s)", group->gr_name);
    Source: str_printfa(errmsg, ") failed: Operation not permitted (egid=%s",
M | 213 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 209 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: str_printfa(errmsg, ") failed: Operation not permitted (egid=%s",
    Source: str_printfa(errmsg, "(%s)", group->gr_name);

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

env_put (15 to 23 env-util.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Pointer not checked for null before use : env_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: env_pool = pool_alloconly_create(MEMPOOL_GROWING"Environment",
    Source: if (putenv(p_strdup(env_pool, env)) != 0)
M | 22 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: env_pool = pool_alloconly_create(MEMPOOL_GROWING"Environment",
    Source: i_fatal("putenv(%s) failed: %m", env);
M | 22 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: env_pool = pool_alloconly_create(MEMPOOL_GROWING"Environment",
    Source: i_fatal("putenv(%s) failed: %m", env);

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

env_backup_save (73 to 91 env-util.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Local structure returned in function result : env |
    Source: return env;
M | 85 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: pool = pool_alloconly_create("saved environment", 4096);
    Source: env = p_new(pool, struct env_backup, 1);
M | 86 | Pointer not checked for null before use : env | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: env = p_new(pool, struct env_backup, 1);
    Source: env->pool = pool;
M | 84 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_assert(environ != NULL);
    Source: pool = pool_alloconly_create("saved environment", 4096);
M | 84 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_assert(environ != NULL);
    Source: pool = pool_alloconly_create("saved environment", 4096);

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

env_backup_restore (93 to 100 env-util.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 99 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: env_clean();
    Source: env_put(env->strings[i]);
M | 99 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: env_clean();
    Source: env_put(env->strings[i]);

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

execv_const (21 to 26 execv-const.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 24 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: (void)execv(path, argv_drop_const(argv));
    Source: i_fatal_status(errno == ENOMEM ? FATAL_OUTOFMEM : FATAL_EXEC,
M | 24 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: (void)execv(path, argv_drop_const(argv));
    Source: i_fatal_status(errno == ENOMEM ? FATAL_OUTOFMEM : FATAL_EXEC,

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

execvp_const (28 to 33 execv-const.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 31 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: (void)execvp(file, argv_drop_const(argv));
    Source: i_fatal_status(errno == ENOMEM ? FATAL_OUTOFMEM : FATAL_EXEC,
M | 31 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: (void)execvp(file, argv_drop_const(argv));
    Source: i_fatal_status(errno == ENOMEM ? FATAL_OUTOFMEM : FATAL_EXEC,

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

log_prefix_add (60 to 76 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 75 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: str_append(str, buf);
    Source: str_append(str, log_prefix);
M | 75 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: str_append(str, buf);
    Source: str_append(str, log_prefix);

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

log_fd_write (83 to 119 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: data += ret;
    Source: while ((ret = write(fd, data, len)) != (ssize_t)len) {
M | 112 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: io_loop_destroy(&ioloop);
    Source: ioloop = io_loop_create();
M | 112 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: io_loop_destroy(&ioloop);
    Source: ioloop = io_loop_create();
M | 114 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 112 |  |
    Source: ioloop = io_loop_create();
    Source: io_loop_run(ioloop);
M | 115 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: io_loop_run(ioloop);
    Source: io_remove(&io);
M | 115 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: io_loop_run(ioloop);
    Source: io_remove(&io);
M | 116 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: io_remove(&io);
    Source: io_loop_destroy(&ioloop);
M | 116 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: io_remove(&io);
    Source: io_loop_destroy(&ioloop);

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

default_handler (121 to 151 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 135 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 134 |  |
    Source: T_BEGIN {
    Source: string_t *str = t_str_new(256);
M | 135 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 134 |  |
    Source: T_BEGIN {
    Source: string_t *str = t_str_new(256);
M | 136 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: string_t *str = t_str_new(256);
    Source: log_prefix_add(str);
M | 136 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: string_t *str = t_str_new(256);
    Source: log_prefix_add(str);
M | 136 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: string_t *str = t_str_new(256);
    Source: log_prefix_add(str);
M | 137 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 136 |  |
    Source: log_prefix_add(str);
    Source: str_append(str, prefix);
M | 137 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 136 |  |
    Source: log_prefix_add(str);
    Source: str_append(str, prefix);
M | 140 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: str_append(str, prefix);
    Source: str_vprintfa(str, printf_format_fix(format), args);
M | 140 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: str_append(str, prefix);
    Source: str_vprintfa(str, printf_format_fix(format), args);
M | 141 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: str_vprintfa(str, printf_format_fix(format), args);
    Source: str_append_c(str, '\n');
M | 141 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: str_vprintfa(str, printf_format_fix(format), args);
    Source: str_append_c(str, '\n');
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: str_append_c(str, '\n');
    Source: ret = log_fd_write(fd, str_data(str), str_len(str));
M | 143 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: str_append_c(str, '\n');
    Source: ret = log_fd_write(fd, str_data(str), str_len(str));
M | 144 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: ret = log_fd_write(fd, str_data(str), str_len(str));
    Source: } T_END;
M | 144 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: ret = log_fd_write(fd, str_data(str), str_len(str));
    Source: } T_END;

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

default_fatal_finish (153 to 167 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 160 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 159 |  |
    Source: if (backtrace_get(&backtrace) == 0)
    Source: i_error("Raw backtrace: %s", backtrace);
M | 160 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 159 |  |
    Source: if (backtrace_get(&backtrace) == 0)
    Source: i_error("Raw backtrace: %s", backtrace);

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

default_fatal_handler (169 to 177 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 172 | Array Bound exceeded. | CERT ARR30-C
    Source: if (default_handler(failure_log_type_prefixes[type], log_fd, format,
M | 176 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 172 |  |
    Source: if (default_handler(failure_log_type_prefixes[type], log_fd, format,
    Source: default_fatal_finish(type, status);
M | 176 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 172 |  |
    Source: if (default_handler(failure_log_type_prefixes[type], log_fd, format,
    Source: default_fatal_finish(type, status);

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

default_error_handler (179 to 203 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 194 | Array Bound exceeded. | CERT ARR30-C
    Source: if (default_handler(failure_log_type_prefixes[type],
M | 200 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 194 |  |
    Source: if (default_handler(failure_log_type_prefixes[type],
    Source: i_fatal_status(FATAL_LOGWRITE, "write() failed to %s log: %m",
M | 200 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 194 |  |
    Source: if (default_handler(failure_log_type_prefixes[type],
    Source: i_fatal_status(FATAL_LOGWRITE, "write() failed to %s log: %m",

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

syslog_handler (339 to 359 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 355 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 350 |  |
    Source: T_BEGIN {
    Source: t_strdup_vprintf(format, args));
M | 355 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 350 |  |
    Source: T_BEGIN {
    Source: t_strdup_vprintf(format, args));
M | 356 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 355 |  |
    Source: t_strdup_vprintf(format, args));
    Source: } T_END;
M | 356 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 355 |  |
    Source: t_strdup_vprintf(format, args));
    Source: } T_END;

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

i_syslog_fatal_handler (361 to 369 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 368 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: if (syslog_handler(LOG_CRIT, type, fmt, args) < 0 &&
    Source: default_fatal_finish(type, status);
M | 368 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: if (syslog_handler(LOG_CRIT, type, fmt, args) < 0 &&
    Source: default_fatal_finish(type, status);

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

i_syslog_error_handler (371 to 399 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 397 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 394 |  |
    Source: i_unreached();
    Source: if (syslog_handler(level, type, fmt, args) < 0)
M | 397 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 394 |  |
    Source: i_unreached();
    Source: if (syslog_handler(level, type, fmt, args) < 0)

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

open_log_file (411 to 438 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 434 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 428 |  |
    Source: str = t_strdup_printf("Can't open log file %s: %m\n",
    Source: i_fatal_status(FATAL_LOGOPEN, "%s", str);
M | 436 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: i_fatal_status(FATAL_LOGOPEN, "%s", str);
    Source: fd_close_on_exec(*fd, TRUE);
M | 434 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 428 |  |
    Source: str = t_strdup_printf("Can't open log file %s: %m\n",
    Source: i_fatal_status(FATAL_LOGOPEN, "%s", str);
M | 436 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: i_fatal_status(FATAL_LOGOPEN, "%s", str);
    Source: fd_close_on_exec(*fd, TRUE);
M | 418 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 417 |  |
    Source: str = t_strdup_printf("close(%d) failed: %m", *fd);
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));
M | 418 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 418 |  |
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));
M | 430 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 428 |  |
    Source: str = t_strdup_printf("Can't open log file %s: %m\n",
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));
M | 430 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 430 |  |
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));
    Source: (void)write_full(STDERR_FILENO, str, strlen(str));

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

i_set_failure_file (440 to 465 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 455 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 452 |  |
    Source: i_error("close(%d) failed: %m", log_debug_fd);
    Source: open_log_file(&log_fd, path);
M | 455 | Pointer not checked for null before use : log_prefix | CERT EXP08-C,EXP34-C
| 442 |  |
    Source: i_set_failure_prefix(prefix);
    Source: open_log_file(&log_fd, path);
M | 455 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 452 |  |
    Source: i_error("close(%d) failed: %m", log_debug_fd);
    Source: open_log_file(&log_fd, path);
M | 461 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: i_set_fatal_handler(NULL);
M | 462 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: i_set_error_handler(NULL);
M | 463 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: i_set_info_handler(NULL);
M | 464 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: i_set_debug_handler(NULL);

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

i_failure_send_option (467 to 477 failures.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 476 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 474 |  |
    Source: str = t_strdup_printf("\001%c%s %s=%s\n", LOG_TYPE_OPTION+1,
    Source: (void)write_full(2, str, strlen(str));
M | 476 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 476 |  |
    Source: (void)write_full(2, str, strlen(str));
    Source: (void)write_full(2, str, strlen(str));
M | 471 | Procedure contains UR data flow anomalies. : callback | CERT EXP33-C
    Source: if (error_handler != i_internal_error_handler)

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
failures.c | 471 | failures.c | 471 | callback
    Source: if (error_handler != i_internal_error_handler)

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

i_set_failure_prefix (479 to 485 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 481 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(log_prefix);
M | 482 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 481 |  |
    Source: i_free(log_prefix);
    Source: log_prefix = i_strdup(prefix);
M | 482 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: log_prefix = i_strdup(prefix);
M | 484 | Attempt to read from freed memory. : log_prefix | CERT MEM30-C
    Source: i_failure_send_option("prefix", prefix);
M | 481 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 639) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FAILURES_639.ref" looking for line -1105
    Source: i_free(log_prefix);
M | 481 | Pointer not checked for null before use : log_prefix | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: static char *log_prefix = NULL, *log_stamp_format = NULL;
    Source: i_free(log_prefix);

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

internal_send_split (487 to 505 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 497 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 493 |  |
    Source: str_append_n(str, str_c(full_str), prefix_len);
    Source: str_truncate(str, prefix_len);
M | 497 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 493 |  |
    Source: str_append_n(str, str_c(full_str), prefix_len);
    Source: str_truncate(str, prefix_len);
M | 493 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 492 |  |
    Source: str = t_str_new(PIPE_BUF);
    Source: str_append_n(str, str_c(full_str), prefix_len);
M | 493 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 492 |  |
    Source: str = t_str_new(PIPE_BUF);
    Source: str_append_n(str, str_c(full_str), prefix_len);
M | 493 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 492 |  |
    Source: str = t_str_new(PIPE_BUF);
    Source: str_append_n(str, str_c(full_str), prefix_len);
M | 498 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 497 |  |
    Source: str_truncate(str, prefix_len);
    Source: str_append_n(str, str_c(full_str) + pos, max_text_len);
M | 498 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 497 |  |
    Source: str_truncate(str, prefix_len);
    Source: str_append_n(str, str_c(full_str) + pos, max_text_len);
M | 499 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 498 |  |
    Source: str_append_n(str, str_c(full_str) + pos, max_text_len);
    Source: str_append_c(str, '\n');
M | 499 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 498 |  |
    Source: str_append_n(str, str_c(full_str) + pos, max_text_len);
    Source: str_append_c(str, '\n');
M | 500 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 499 |  |
    Source: str_append_c(str, '\n');
    Source: if (log_fd_write(2, str_data(str), str_len(str)) < 0)
M | 500 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 499 |  |
    Source: str_append_c(str, '\n');
    Source: if (log_fd_write(2, str_data(str), str_len(str)) < 0)

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

internal_handler (507 to 542 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 530 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 528 |  |
    Source: str_vprintfa(str, format, args);
    Source: str_append_c(str, '\n');
M | 533 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 528 |  |
    Source: str_vprintfa(str, format, args);
    Source: ret = internal_send_split(str, prefix_len);
M | 535 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 533 |  |
    Source: ret = internal_send_split(str, prefix_len);
    Source: } T_END;
M | 530 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 528 |  |
    Source: str_vprintfa(str, format, args);
    Source: str_append_c(str, '\n');
M | 533 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 528 |  |
    Source: str_vprintfa(str, format, args);
    Source: ret = internal_send_split(str, prefix_len);
M | 535 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 533 |  |
    Source: ret = internal_send_split(str, prefix_len);
    Source: } T_END;
M | 524 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 520 |  |
    Source: T_BEGIN {
    Source: str = t_str_new(128);
M | 524 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 520 |  |
    Source: T_BEGIN {
    Source: str = t_str_new(128);
M | 525 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 524 |  |
    Source: str = t_str_new(128);
    Source: str_printfa(str, "\001%c%s ", log_type + 1, my_pid);
M | 525 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 524 |  |
    Source: str = t_str_new(128);
    Source: str_printfa(str, "\001%c%s ", log_type + 1, my_pid);
M | 525 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 524 |  |
    Source: str = t_str_new(128);
    Source: str_printfa(str, "\001%c%s ", log_type + 1, my_pid);
M | 528 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 525 |  |
    Source: str_printfa(str, "\001%c%s ", log_type + 1, my_pid);
    Source: str_vprintfa(str, format, args);
M | 528 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 525 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: str_printfa(str, "\001%c%s ", log_type + 1, my_pid);
    Source: str_vprintfa(str, format, args);
M | 531 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 530 |  |
    Source: str_append_c(str, '\n');
    Source: ret = log_fd_write(2, str_data(str), str_len(str));
M | 531 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 530 |  |
    Source: str_append_c(str, '\n');
    Source: ret = log_fd_write(2, str_data(str), str_len(str));

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

i_failure_parse_line (561 to 583 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 565 | Pointer not checked for null before use : failure | CERT EXP08-C,EXP34-C
| 563 |  |
    Source: memset(failure, 0, sizeof(*failure));
    Source: failure->log_type = LOG_TYPE_ERROR;
M | 569 | Pointer not checked for null before use : failure | CERT EXP08-C,EXP34-C
| 563 |  |
    Source: memset(failure, 0, sizeof(*failure));
    Source: failure->log_type = line[1] - 1;
M | 572 | Pointer not checked for null before use : line | CERT EXP08-C,EXP34-C
| 571 |  |
    Source: line += 2;
    Source: failure->text = line;

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

i_internal_fatal_handler (585 to 594 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 593 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 589 |  |
    Source: if (internal_handler(type, fmt, args) < 0 &&
    Source: default_fatal_finish(type, status);
M | 593 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 589 |  |
    Source: if (internal_handler(type, fmt, args) < 0 &&
    Source: default_fatal_finish(type, status);

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

i_set_info_file (616 to 627 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 626 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: i_set_debug_handler(NULL);

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

i_set_failure_timestamp_format (638 to 642 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 640 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(log_stamp_format);
M | 641 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 640 |  |
    Source: i_free(log_stamp_format);
    Source: log_stamp_format = i_strdup(fmt);
M | 641 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: log_stamp_format = i_strdup(fmt);
M | 640 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 639) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FAILURES_639.ref" looking for line -1105
    Source: i_free(log_stamp_format);
M | 640 | Pointer not checked for null before use : log_stamp_format | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: static char *log_prefix = NULL, *log_stamp_format = NULL;
    Source: i_free(log_stamp_format);

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

failures_deinit (654 to 679 failures.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 677 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free_and_null(log_prefix);
M | 678 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free_and_null(log_stamp_format);
M | 678 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 677 |  |
    Source: i_free_and_null(log_prefix);
    Source: i_free_and_null(log_stamp_format);
M | 678 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free_and_null(log_stamp_format);

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

fd_close_on_exec (12 to 23 fd-close-on-exec.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 22 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("fcntl(F_GETFD, %d) failed: %m", fd);
    Source: i_fatal("fcntl(F_SETFD, %d) failed: %m", fd);
M | 22 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("fcntl(F_GETFD, %d) failed: %m", fd);
    Source: i_fatal("fcntl(F_SETFD, %d) failed: %m", fd);

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

fd_debug_verify_leaks (25 to 84 fd-close-on-exec.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_panic("Leaked file fd %d: dev %s.%s inode %s",
    Source: first_fd, dec2str(major(st.st_dev)),
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_panic("Leaked file fd %d: dev %s.%s inode %s",
    Source: first_fd, dec2str(major(st.st_dev)),
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: first_fd, dec2str(major(st.st_dev)),
    Source: dec2str(minor(st.st_dev)), dec2str(st.st_ino));
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: first_fd, dec2str(major(st.st_dev)),
    Source: dec2str(minor(st.st_dev)), dec2str(st.st_ino));
M | 72 | User input not checked before use. : st | CERT FIO30-C
| 61 |  |
    Source: if (fstat(first_fd, &st) == 0) {
    Source: first_fd, dec2str(major(st.st_dev)),
M | 52 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: i_panic("Leaked UNIX socket fd %d: %s",
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {
    Source: i_panic("Leaked socket fd %d: %s:%u -> %s:%u",
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dec2str(minor(st.st_dev)), dec2str(st.st_ino));
    Source: i_panic("Leaked unknown fd %d (errno = %s)",
M | 38 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: i_panic("Leaked unknown fd %d (errno = %s)",
    Source: if (net_getsockname(first_fd, &addr, &port) == 0) {
M | 52 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: i_panic("Leaked UNIX socket fd %d: %s",
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {
    Source: i_panic("Leaked socket fd %d: %s:%u -> %s:%u",
M | 81 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dec2str(minor(st.st_dev)), dec2str(st.st_ino));
    Source: i_panic("Leaked unknown fd %d (errno = %s)",
M | 38 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 81 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_panic("Leaked unknown fd %d (errno = %s)",
    Source: if (net_getsockname(first_fd, &addr, &port) == 0) {
M | 27 | Procedure contains UR data flow anomalies. : addr.family | CERT EXP33-C
| 39 |  |
    Source: if (addr.family == AF_UNIX) {
    Source: struct ip_addr addr, raddr;
M | 27 | Procedure contains UR data flow anomalies. : addr.u.ip4 | CERT EXP33-C
| 57 |  |
    Source: first_fd, net_ip2addr(&addr), port,
    Source: struct ip_addr addr, raddr;
M | 27 | Procedure contains UR data flow anomalies. : addr.u.ip6 | CERT EXP33-C
| 57 |  |
    Source: first_fd, net_ip2addr(&addr), port,
    Source: struct ip_addr addr, raddr;
M | 28 | Procedure contains UR data flow anomalies. : port | CERT EXP33-C
| 38 |  |
    Source: if (net_getsockname(first_fd, &addr, &port) == 0) {
    Source: unsigned int port, rport;
M | 27 | Procedure contains UR data flow anomalies. : raddr.family | CERT EXP33-C
| 58 |  |
    Source: net_ip2addr(&raddr), rport);
    Source: struct ip_addr addr, raddr;
M | 27 | Procedure contains UR data flow anomalies. : raddr.u.ip4 | CERT EXP33-C
| 58 |  |
    Source: net_ip2addr(&raddr), rport);
    Source: struct ip_addr addr, raddr;
M | 27 | Procedure contains UR data flow anomalies. : raddr.u.ip6 | CERT EXP33-C
| 58 |  |
    Source: net_ip2addr(&raddr), rport);
    Source: struct ip_addr addr, raddr;
M | 28 | Procedure contains UR data flow anomalies. : rport | CERT EXP33-C
| 52 |  |
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {
    Source: unsigned int port, rport;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 39 | addr.family
    Source: struct ip_addr addr, raddr;
    Source: if (addr.family == AF_UNIX) {
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 57 | addr.u.ip4
    Source: struct ip_addr addr, raddr;
    Source: first_fd, net_ip2addr(&addr), port,
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 57 | addr.u.ip6
    Source: struct ip_addr addr, raddr;
    Source: first_fd, net_ip2addr(&addr), port,
fd-close-on-exec.c | 28 | fd-close-on-exec.c | 38 | port
    Source: unsigned int port, rport;
    Source: if (net_getsockname(first_fd, &addr, &port) == 0) {
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 58 | raddr.family
    Source: struct ip_addr addr, raddr;
    Source: net_ip2addr(&raddr), rport);
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 58 | raddr.u.ip4
    Source: struct ip_addr addr, raddr;
    Source: net_ip2addr(&raddr), rport);
fd-close-on-exec.c | 27 | fd-close-on-exec.c | 58 | raddr.u.ip6
    Source: struct ip_addr addr, raddr;
    Source: net_ip2addr(&raddr), rport);
fd-close-on-exec.c | 28 | fd-close-on-exec.c | 52 | rport
    Source: unsigned int port, rport;
    Source: if (net_getpeername(first_fd, &raddr, &rport) < 0) {

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

file_cache_new (19 to 27 file-cache.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 26 | Local structure returned in function result : cache |
    Source: return cache;
M | 24 | Pointer not checked for null before use : cache | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: cache = i_new(struct file_cache, 1);
    Source: cache->fd = fd;
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 644) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FILE-CACHE_644.ref" looking for line -1105
    Source: cache = i_new(struct file_cache, 1);

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

file_cache_free (29 to 41 file-cache.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 40 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_error("munmap_anon() failed: %m");
    Source: i_free(cache);

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

file_cache_set_size (49 to 88 file-cache.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_assert((size % page_size) == 0);
    Source: i_error("file_cache_set_size(%"PRIuUOFF_T"): size too large",
M | 63 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_assert((size % page_size) == 0);
    Source: i_error("file_cache_set_size(%"PRIuUOFF_T"): size too large",

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

file_cache_read (90 to 212 file-cache.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 206 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 195 |  |
    Source: bits[high_poffset / CHAR_BIT] &=
    Source: bits[poffset / CHAR_BIT] |= 1 << (poffset % CHAR_BIT);
M | 195 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: bits[poffset / CHAR_BIT] &=
    Source: bits[high_poffset / CHAR_BIT] &=
M | 177 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: bits[poffset / CHAR_BIT] &=
    Source: bits[poffset / CHAR_BIT] |=
M | 166 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 138 |  |
    Source: dest = PTR_OFFSET(cache->mmap_base, dest_offset);
    Source: ret = pread(cache->fd, dest, dest_size, dest_offset);
M | 133 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: i_assert(psize > 0);
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
M | 155 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 133 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
    Source: i_assert(psize == 1);
M | 133 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: i_assert(psize > 0);
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
M | 155 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 133 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
    Source: i_assert(psize == 1);

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

file_cache_write (220 to 261 file-cache.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 243 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 241 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask,
    Source: *bits &= ~(1 << (page % CHAR_BIT));
M | 257 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 254 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
    Source: bits[first_page / CHAR_BIT] |=
M | 229 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 227 |  |
    Source: i_assert((uoff_t)-1 - offset > size);
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
M | 232 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
    Source: file_cache_invalidate(cache, offset, size);
M | 241 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask,
M | 254 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 241 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask,
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,
M | 229 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 227 |  |
    Source: i_assert((uoff_t)-1 - offset > size);
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
M | 232 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
    Source: file_cache_invalidate(cache, offset, size);
M | 241 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: if (file_cache_set_size(cache, offset + size) < 0) {
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask,
M | 254 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 241 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask,
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, 0,

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

file_cache_invalidate (263 to 317 file-cache.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 : bits | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: memset(bits, 0, size / CHAR_BIT);
    Source: bits += size / CHAR_BIT;
M | 304 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 296 |  |
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, offset / CHAR_BIT,
    Source: *bits++ &= ~mask;
M | 315 | Pointer not checked for null before use : bits | CERT EXP08-C,EXP34-C
| 308 |  |
    Source: bits += size / CHAR_BIT;
    Source: *bits &= ~mask;
M | 296 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: i_assert(size > offset);
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, offset / CHAR_BIT,
M | 296 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: i_assert(size > offset);
    Source: bits = buffer_get_space_unsafe(cache->page_bitmask, offset / CHAR_BIT,
M | 266 | Procedure contains UR data flow anomalies. : mask | CERT EXP33-C
| 300 |  |
    Source: for (i = offset % CHAR_BIT, mask = 0; i < CHAR_BIT && size > 0; i++) {
    Source: unsigned char *bits, mask;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
file-cache.c | 266 | file-cache.c | 300 | mask
    Source: unsigned char *bits, mask;
    Source: for (i = offset % CHAR_BIT, mask = 0; i < CHAR_BIT && size > 0; i++) {

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

file_copy_to_tmp (13 to 92 file-copy.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: input = i_stream_create_fd(fd_in, 0, FALSE);
    Source: output = o_stream_create_fd_file(fd_out, 0, FALSE);
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_stream_destroy(&input);
    Source: o_stream_destroy(&output);
M | 81 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_stream_destroy(&input);
    Source: o_stream_destroy(&output);
M | 60 | User input not checked before use. : st | CERT FIO30-C
| 53 |  |
    Source: if (fstat(fd_in, &st) < 0) {
    Source: fd_out = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, st.st_mode);
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: i_error("fchown(%s) failed: %m", tmppath);
    Source: input = i_stream_create_fd(fd_in, 0, FALSE);
M | 80 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_error("write(%s) failed: %m", tmppath);
    Source: i_stream_destroy(&input);
M | 84 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: o_stream_destroy(&output);
    Source: i_error("close(%s) failed: %m", srcpath);
M | 88 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_error("close(%s) failed: %m", srcpath);
    Source: i_error("close(%s) failed: %m", tmppath);
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: i_error("fchown(%s) failed: %m", tmppath);
    Source: input = i_stream_create_fd(fd_in, 0, FALSE);
M | 80 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_error("write(%s) failed: %m", tmppath);
    Source: i_stream_destroy(&input);
M | 84 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: o_stream_destroy(&output);
    Source: i_error("close(%s) failed: %m", srcpath);
M | 88 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_error("close(%s) failed: %m", srcpath);
    Source: i_error("close(%s) failed: %m", tmppath);

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

file_copy (94 to 115 file-copy.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 101 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 98 |  |
    Source: T_BEGIN {
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
M | 101 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 98 |  |
    Source: T_BEGIN {
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
M | 103 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
M | 103 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
M | 103 | Pointer not checked for null before use : tmppath | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
M | 113 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 103 |  |
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
    Source: } T_END;
M | 106 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 103 |  |
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
    Source: i_error("rename(%s, %s) failed: %m",
M | 113 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 103 |  |
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
    Source: } T_END;
M | 106 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 103 |  |
    Source: ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
    Source: i_error("rename(%s, %s) failed: %m",
M | 105 | Pointer not checked for null before use : tmppath | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
    Source: if (rename(tmppath, destpath) < 0) {
M | 112 | Pointer not checked for null before use : tmppath | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: tmppath = t_strconcat(destpath, ".tmp", NULL);
    Source: (void)unlink(tmppath);

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

file_dotlock_alloc (76 to 89 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 88 | Local structure returned in function result : dotlock |
    Source: return dotlock;
M | 82 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: dotlock = i_new(struct dotlock, 1);
    Source: dotlock->settings = *settings;
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 646) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FILE-DOTLOCK_646.ref" looking for line -1105
    Source: dotlock = i_new(struct dotlock, 1);

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

read_local_pid (91 to 128 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 109 | Array Bound exceeded. | CERT ARR30-C
    Source: if (buf[ret-1] == '\n')
M | 114 | User input not checked before use. : buf | CERT FIO30-C
| 111 |  |
    Source: buf[ret] = '\0';
    Source: host = strchr(buf, ':');

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

update_lock_info (162 to 187 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 171 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 170 |  |
    Source: nfs_flush_file_handle_cache(lock_info->lock_path);
    Source: nfs_flush_attr_cache_unlocked(lock_info->lock_path);
M | 171 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 170 |  |
    Source: nfs_flush_file_handle_cache(lock_info->lock_path);
    Source: nfs_flush_attr_cache_unlocked(lock_info->lock_path);
M | 175 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 171 |  |
    Source: nfs_flush_attr_cache_unlocked(lock_info->lock_path);
    Source: if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) {
M | 177 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 175 |  |
    Source: if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_info->lock_path);
M | 175 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 171 |  |
    Source: nfs_flush_attr_cache_unlocked(lock_info->lock_path);
    Source: if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) {
M | 177 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 175 |  |
    Source: if (nfs_safe_lstat(lock_info->lock_path, &st) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_info->lock_path);

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

check_lock (205 to 299 file-dotlock.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 276 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 275 |  |
    Source: nfs_flush_file_handle_cache(lock_info->path);
    Source: nfs_flush_attr_cache_maybe_locked(lock_info->path);
M | 276 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 275 |  |
    Source: nfs_flush_file_handle_cache(lock_info->path);
    Source: nfs_flush_attr_cache_maybe_locked(lock_info->path);
M | 278 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 276 |  |
    Source: nfs_flush_attr_cache_maybe_locked(lock_info->path);
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
M | 259 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 254 |  |
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
    Source: return dotlock_override(lock_info);
M | 283 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 278 |  |
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
    Source: i_error("stat(%s) failed: %m", lock_info->path);
M | 295 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 278 |  |
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
    Source: return dotlock_override(lock_info);
M | 254 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 212 |  |
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
M | 278 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 276 |  |
    Source: nfs_flush_attr_cache_maybe_locked(lock_info->path);
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
M | 259 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 254 |  |
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
    Source: return dotlock_override(lock_info);
M | 283 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 278 |  |
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
    Source: i_error("stat(%s) failed: %m", lock_info->path);
M | 295 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 278 |  |
    Source: if (nfs_safe_stat(lock_info->path, &st) < 0) {
    Source: return dotlock_override(lock_info);
M | 254 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 212 |  |
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
    Source: if ((ret = update_lock_info(now, lock_info, &changed)) != 0)
M | 209 | Procedure contains UR data flow anomalies. : changed | CERT EXP33-C
| 214 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: if (changed || !lock_info->pid_read) {
    Source: bool changed;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
file-dotlock.c | 209 | file-dotlock.c | 214 | changed
    Source: bool changed;
    Source: if (changed || !lock_info->pid_read) {

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

file_write_pid (301 to 316 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 307 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: str = t_strdup_printf("%s:%s", my_pid, my_hostname);
    Source: if (write_full(fd, str, strlen(str)) < 0 ||
M | 307 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: if (write_full(fd, str, strlen(str)) < 0 ||
    Source: if (write_full(fd, str, strlen(str)) < 0 ||
M | 311 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: str = t_strdup_printf("%s:%s", my_pid, my_hostname);
    Source: i_error("ftruncate(%s) failed: %m", path);
M | 311 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: str = t_strdup_printf("%s:%s", my_pid, my_hostname);
    Source: i_error("ftruncate(%s) failed: %m", path);

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

try_create_lock_hardlink (318 to 389 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 337 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 335 |  |
    Source: str_append_n(tmp_path, lock_info->lock_path,
    Source: str_append_c(tmp_path, '/');
M | 337 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 335 |  |
    Source: str_append_n(tmp_path, lock_info->lock_path,
    Source: str_append_c(tmp_path, '/');
M | 345 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 343 |  |
    Source: str_append_n(tmp_path, lock_info->lock_path,
    Source: str_append_c(tmp_path, '/');
M | 345 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 343 |  |
    Source: str_append_n(tmp_path, lock_info->lock_path,
    Source: str_append_c(tmp_path, '/');
M | 359 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 359 |  |
    Source: if (file_write_pid(lock_info->fd,
    Source: if (file_write_pid(lock_info->fd,
M | 359 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 359 |  |
    Source: if (file_write_pid(lock_info->fd,
    Source: if (file_write_pid(lock_info->fd,
M | 331 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: i_assert(lock_info->fd == -1);
    Source: str_truncate(tmp_path, 0);
M | 339 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 337 |  |
    Source: str_append_c(tmp_path, '/');
    Source: str_append(tmp_path, temp_prefix);
M | 347 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 345 |  |
    Source: str_append_c(tmp_path, '/');
    Source: str_printfa(tmp_path, ".temp.%s.%s.",
M | 352 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 347 |  |
    Source: str_printfa(tmp_path, ".temp.%s.%s.",
    Source: lock_info->fd = safe_mkstemp(tmp_path, 0666 ^ old_mask,
M | 368 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: lock_info->fd = safe_mkstemp(tmp_path, 0666 ^ old_mask,
    Source: lock_info->temp_path = str_c(tmp_path);
M | 384 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 368 |  |
    Source: lock_info->temp_path = str_c(tmp_path);
    Source: i_error("unlink(%s) failed: %m", lock_info->temp_path);
M | 331 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 327 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_assert(lock_info->fd == -1);
    Source: str_truncate(tmp_path, 0);
M | 339 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 337 |  |
    Source: str_append_c(tmp_path, '/');
    Source: str_append(tmp_path, temp_prefix);
M | 347 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 345 |  |
    Source: str_append_c(tmp_path, '/');
    Source: str_printfa(tmp_path, ".temp.%s.%s.",
M | 352 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 347 |  |
    Source: str_printfa(tmp_path, ".temp.%s.%s.",
    Source: lock_info->fd = safe_mkstemp(tmp_path, 0666 ^ old_mask,
M | 368 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: lock_info->fd = safe_mkstemp(tmp_path, 0666 ^ old_mask,
    Source: lock_info->temp_path = str_c(tmp_path);
M | 384 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 368 |  |
    Source: lock_info->temp_path = str_c(tmp_path);
    Source: i_error("unlink(%s) failed: %m", lock_info->temp_path);
M | 387 | Procedure contains UR data flow anomalies. : lock_info.temp_path | CERT EXP33-C
| 465 |  |
    Source: struct lock_info lock_info;
    Source: lock_info->temp_path = NULL;

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

dotlock_wait (422 to 457 file-dotlock.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 454 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 453 |  |
    Source: io_loop_run(ioloop);
    Source: io_remove(&io);
M | 454 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 453 |  |
    Source: io_loop_run(ioloop);
    Source: io_remove(&io);
M | 455 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 454 |  |
    Source: io_remove(&io);
    Source: timeout_remove(&to);
M | 455 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 454 |  |
    Source: io_remove(&io);
    Source: timeout_remove(&to);
M | 456 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 455 |  |
    Source: timeout_remove(&to);
    Source: io_loop_destroy(&ioloop);
M | 456 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 455 |  |
    Source: timeout_remove(&to);
    Source: io_loop_destroy(&ioloop);
M | 440 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_destroy(&ioloop);
M | 444 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_destroy(&ioloop);
M | 453 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_run(ioloop);
M | 440 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_destroy(&ioloop);
M | 444 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_destroy(&ioloop);
M | 453 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 434 |  |
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
    Source: io_loop_run(ioloop);
M | 434 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 433 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: ioloop = io_loop_create();
    Source: switch (io_add_notify(lock_info->lock_path, dotlock_wait_end,
M | 426 | Procedure contains UR data flow anomalies. : to | CERT EXP33-C
| 455 |  |
    Source: timeout_remove(&to);
    Source: struct timeout *to;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
file-dotlock.c | 426 | file-dotlock.c | 455 | to
    Source: struct timeout *to;
    Source: timeout_remove(&to);

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

dotlock_create (459 to 590 file-dotlock.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 569 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 567 |  |
    Source: i_warning("Created dotlock file's timestamp is "
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
M | 569 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 567 |  |
    Source: i_warning("Created dotlock file's timestamp is "
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
M | 569 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 569 |  |
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
M | 569 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 569 |  |
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
    Source: "(%s vs %s): %s", dec2str(st.st_ctime),
M | 487 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 477 |  |
    Source: lock_path = *lock_path_r =
    Source: lock_info.lock_path = lock_path;
M | 521 | Pointer not checked for null before use : lock_info.lock_path | CERT EXP08-C,EXP34-C
| 487 |  |
    Source: lock_info.lock_path = lock_path;
    Source: try_create_lock_hardlink(&lock_info, write_pid,
M | 521 | Pointer not checked for null before use : lock_info.set | CERT EXP08-C,EXP34-C
| 486 |  |
    Source: lock_info.set = set;
    Source: try_create_lock_hardlink(&lock_info, write_pid,
M | 558 | User input not checked before use. : st | CERT FIO30-C
| 553 |  |
    Source: if (fstat(lock_info.fd, &st) < 0) {
    Source: dotlock->dev = st.st_dev;
M | 521 | Pointer not checked for null before use : tmp_path | CERT EXP08-C,EXP34-C
| 482 |  |
    Source: tmp_path = t_str_new(256);
    Source: try_create_lock_hardlink(&lock_info, write_pid,
M | 511 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 508 |  |
    Source: dotlock_wait(&lock_info);
    Source: ret = check_lock(now, &lock_info);
M | 482 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 477 |  |
    Source: lock_path = *lock_path_r =
    Source: tmp_path = t_str_new(256);
M | 554 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 511 |  |
    Source: ret = check_lock(now, &lock_info);
    Source: i_error("fstat(%s) failed: %m", lock_path);
M | 521 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 511 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: ret = check_lock(now, &lock_info);
    Source: try_create_lock_hardlink(&lock_info, write_pid,
M | 579 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 554 |  |
    Source: i_error("fstat(%s) failed: %m", lock_path);
    Source: i_error("close(%s) failed: %m", lock_path);
M | 584 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 579 |  |
    Source: i_error("close(%s) failed: %m", lock_path);
    Source: i_error("unlink(%s) failed: %m", lock_info.temp_path);
M | 511 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 508 |  |
    Source: dotlock_wait(&lock_info);
    Source: ret = check_lock(now, &lock_info);
M | 482 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 477 |  |
    Source: lock_path = *lock_path_r =
    Source: tmp_path = t_str_new(256);
M | 554 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 511 |  |
    Source: ret = check_lock(now, &lock_info);
    Source: i_error("fstat(%s) failed: %m", lock_path);
M | 521 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 511 |  |
    Source: ret = check_lock(now, &lock_info);
    Source: try_create_lock_hardlink(&lock_info, write_pid,
M | 579 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 554 |  |
    Source: i_error("fstat(%s) failed: %m", lock_path);
    Source: i_error("close(%s) failed: %m", lock_path);
M | 584 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 579 |  |
    Source: i_error("close(%s) failed: %m", lock_path);
    Source: i_error("unlink(%s) failed: %m", lock_info.temp_path);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
file-dotlock.c | 387 | file-dotlock.c | 521 | lock_info.temp_path
    Source: lock_info->temp_path = NULL;
    Source: try_create_lock_hardlink(&lock_info, write_pid,
file-dotlock.c | 387 | file-dotlock.c | 582 | lock_info.temp_path
    Source: lock_info->temp_path = NULL;
    Source: if (lock_info.temp_path != NULL) {

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

file_dotlock_free (592 to 610 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 608 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 607 |  |
    Source: i_free(dotlock->path);
    Source: i_free(dotlock->lock_path);
M | 608 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(dotlock->lock_path);
M | 609 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 608 |  |
    Source: i_free(dotlock->lock_path);
    Source: i_free(dotlock);
M | 609 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(dotlock);
M | 609 | Pointer not checked for null before use : (dotlock)->path | CERT EXP08-C,EXP34-C
| 607 |  |
    Source: i_free(dotlock->path);
    Source: i_free(dotlock);
M | 609 | Pointer not checked for null before use : (dotlock)->lock_path | CERT EXP08-C,EXP34-C
| 608 |  |
    Source: i_free(dotlock->lock_path);
    Source: i_free(dotlock);
M | 607 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 602 |  |
    Source: i_error("close(%s) failed: %m", dotlock->path);
    Source: i_free(dotlock->path);

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

file_dotlock_create_real (612 to 652 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 634 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 619 |  |
    Source: ret = dotlock_create(dotlock, flags, TRUE, &lock_path);
    Source: if (lstat(lock_path, &st) < 0) {
M | 650 | User input not checked before use. : st | CERT FIO30-C
| 634 |  |
    Source: if (lstat(lock_path, &st) < 0) {
    Source: dotlock->mtime = st.st_mtime;
M | 627 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 619 |  |
    Source: ret = dotlock_create(dotlock, flags, TRUE, &lock_path);
    Source: i_error("close(%s) failed: %m", lock_path);
M | 627 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 619 |  |
    Source: ret = dotlock_create(dotlock, flags, TRUE, &lock_path);
    Source: i_error("close(%s) failed: %m", lock_path);

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

file_dotlock_create (654 to 670 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 663 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 662 |  |
    Source: T_BEGIN {
    Source: ret = file_dotlock_create_real(dotlock, flags);
M | 663 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 662 |  |
    Source: T_BEGIN {
    Source: ret = file_dotlock_create_real(dotlock, flags);
M | 663 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 661 |  |
    Source: dotlock = file_dotlock_alloc(set, path);
    Source: ret = file_dotlock_create_real(dotlock, flags);
M | 664 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 663 |  |
    Source: ret = file_dotlock_create_real(dotlock, flags);
    Source: } T_END;
M | 664 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 663 |  |
    Source: ret = file_dotlock_create_real(dotlock, flags);
    Source: } T_END;
M | 666 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 664 |  |
    Source: } T_END;
    Source: file_dotlock_free(&dotlock);
M | 666 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 664 |  |
    Source: } T_END;
    Source: file_dotlock_free(&dotlock);

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

dotlock_replaced_warning (672 to 690 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 679 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 677 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_warning("Our dotlock file %s was %s "
M | 685 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 677 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_warning("Our dotlock file %s was %s "
M | 679 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 677 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_warning("Our dotlock file %s was %s "
M | 685 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 677 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_warning("Our dotlock file %s was %s "

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

file_dotlock_delete (692 to 744 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 701 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 698 |  |
    Source: dotlock = *dotlock_p;
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
M | 702 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 701 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
M | 702 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 701 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
M | 702 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 701 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
M | 705 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 704 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 705 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 704 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 710 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 709 |  |
    Source: i_error("lstat(%s) failed: %m", lock_path);
    Source: file_dotlock_free(&dotlock);
M | 710 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 709 |  |
    Source: i_error("lstat(%s) failed: %m", lock_path);
    Source: file_dotlock_free(&dotlock);
M | 718 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 716 |  |
    Source: dotlock_replaced_warning(dotlock, FALSE);
    Source: file_dotlock_free(&dotlock);
M | 718 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 716 |  |
    Source: dotlock_replaced_warning(dotlock, FALSE);
    Source: file_dotlock_free(&dotlock);
M | 724 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 723 |  |
    Source: i_warning("Our dotlock file %s was modified (%s vs %s), "
    Source: "assuming it wasn't overridden (kept it %d secs)",
M | 724 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 723 |  |
    Source: i_warning("Our dotlock file %s was modified (%s vs %s), "
    Source: "assuming it wasn't overridden (kept it %d secs)",
M | 726 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 724 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: "assuming it wasn't overridden (kept it %d secs)",
    Source: dec2str(dotlock->mtime), dec2str(st.st_mtime),
M | 726 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 724 |  |
    Source: "assuming it wasn't overridden (kept it %d secs)",
    Source: dec2str(dotlock->mtime), dec2str(st.st_mtime),
M | 733 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 732 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 733 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 732 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 738 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 737 |  |
    Source: i_error("unlink(%s) failed: %m", lock_path);
    Source: file_dotlock_free(&dotlock);
M | 738 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 737 |  |
    Source: i_error("unlink(%s) failed: %m", lock_path);
    Source: file_dotlock_free(&dotlock);
M | 709 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 702 |  |
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_path);
M | 742 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 726 |  |
    Source: dec2str(dotlock->mtime), dec2str(st.st_mtime),
    Source: file_dotlock_free(&dotlock);
M | 716 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 702 |  |
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
    Source: dotlock_replaced_warning(dotlock, FALSE);
M | 709 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 702 |  |
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_path);
M | 742 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 726 |  |
    Source: dec2str(dotlock->mtime), dec2str(st.st_mtime),
    Source: file_dotlock_free(&dotlock);
M | 716 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 702 |  |
    Source: if (nfs_safe_lstat(lock_path, &st) < 0) {
    Source: dotlock_replaced_warning(dotlock, FALSE);

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

file_dotlock_open (746 to 768 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 757 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 754 |  |
    Source: T_BEGIN {
    Source: ret = dotlock_create(dotlock, flags, FALSE, &lock_path);
M | 757 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 754 |  |
    Source: T_BEGIN {
    Source: ret = dotlock_create(dotlock, flags, FALSE, &lock_path);
M | 757 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 753 |  |
    Source: dotlock = file_dotlock_alloc(set, path);
    Source: ret = dotlock_create(dotlock, flags, FALSE, &lock_path);
M | 758 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 757 |  |
    Source: ret = dotlock_create(dotlock, flags, FALSE, &lock_path);
    Source: } T_END;
M | 758 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 757 |  |
    Source: ret = dotlock_create(dotlock, flags, FALSE, &lock_path);
    Source: } T_END;
M | 761 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 758 |  |
    Source: } T_END;
    Source: file_dotlock_free(&dotlock);
M | 761 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 758 |  |
    Source: } T_END;
    Source: file_dotlock_free(&dotlock);

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

file_dotlock_open_mode_full (770 to 801 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 788 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 787 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: file_dotlock_get_lock_path(dotlock),
M | 788 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 787 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: file_dotlock_get_lock_path(dotlock),
M | 792 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 791 |  |
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",
    Source: file_dotlock_get_lock_path(dotlock),
M | 792 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 791 |  |
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",
    Source: file_dotlock_get_lock_path(dotlock),
M | 795 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 792 |  |
    Source: file_dotlock_get_lock_path(dotlock),
    Source: file_dotlock_delete(&dotlock);
M | 791 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 781 |  |
    Source: fd = file_dotlock_open(set, path, flags, &dotlock);
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",
M | 795 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 792 |  |
    Source: file_dotlock_get_lock_path(dotlock),
    Source: file_dotlock_delete(&dotlock);
M | 791 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 781 |  |
    Source: fd = file_dotlock_open(set, path, flags, &dotlock);
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",

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

file_dotlock_open_mode (803 to 810 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 808 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return file_dotlock_open_mode_full(set, path, flags, mode, uid, gid,

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

file_dotlock_replace (821 to 851 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 838 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 836 |  |
    Source: dotlock_replaced_warning(dotlock, FALSE);
    Source: file_dotlock_free(&dotlock);
M | 838 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 836 |  |
    Source: dotlock_replaced_warning(dotlock, FALSE);
    Source: file_dotlock_free(&dotlock);
M | 831 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 827 |  |
    Source: dotlock = *dotlock_p;
    Source: dotlock->fd = -1;
M | 833 | Pointer not checked for null before use : dotlock | CERT EXP08-C,EXP34-C
| 827 |  |
    Source: dotlock = *dotlock_p;
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
M | 842 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 833 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (rename(lock_path, dotlock->path) < 0) {
M | 835 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 833 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: !file_dotlock_is_locked(dotlock)) {
M | 845 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 843 |  |
    Source: i_error("rename(%s, %s) failed: %m", lock_path, dotlock->path);
    Source: dotlock_replaced_warning(dotlock, TRUE);
M | 846 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 845 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 836 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 835 |  |
    Source: !file_dotlock_is_locked(dotlock)) {
    Source: dotlock_replaced_warning(dotlock, FALSE);
M | 835 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 833 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: !file_dotlock_is_locked(dotlock)) {
M | 845 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 843 |  |
    Source: i_error("rename(%s, %s) failed: %m", lock_path, dotlock->path);
    Source: dotlock_replaced_warning(dotlock, TRUE);
M | 846 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 845 |  |
    Source: dotlock_replaced_warning(dotlock, TRUE);
    Source: file_dotlock_free(&dotlock);
M | 836 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 835 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: !file_dotlock_is_locked(dotlock)) {
    Source: dotlock_replaced_warning(dotlock, FALSE);

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

file_dotlock_touch (853 to 873 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 866 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 865 |  |
    Source: T_BEGIN {
    Source: const char *lock_path = file_dotlock_get_lock_path(dotlock);
M | 866 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 865 |  |
    Source: T_BEGIN {
    Source: const char *lock_path = file_dotlock_get_lock_path(dotlock);
M | 867 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 866 |  |
    Source: const char *lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (utime(lock_path, &buf) < 0) {
M | 868 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 866 |  |
    Source: const char *lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_error("utime(%s) failed: %m", lock_path);
M | 871 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 868 |  |
    Source: i_error("utime(%s) failed: %m", lock_path);
    Source: } T_END;
M | 868 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 866 |  |
    Source: const char *lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_error("utime(%s) failed: %m", lock_path);
M | 871 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 868 |  |
    Source: i_error("utime(%s) failed: %m", lock_path);
    Source: } T_END;

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

file_dotlock_is_locked (875 to 891 file-dotlock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 886 | Pointer not checked for null before use : lock_path | CERT EXP08-C,EXP34-C
| 880 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st2) < 0) {
M | 882 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 880 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_error("fstat(%s) failed: %m", lock_path);
M | 886 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 880 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st2) < 0) {
M | 887 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 886 |  |
    Source: if (nfs_safe_lstat(lock_path, &st2) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_path);
M | 882 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 880 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: i_error("fstat(%s) failed: %m", lock_path);
M | 886 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 880 |  |
    Source: lock_path = file_dotlock_get_lock_path(dotlock);
    Source: if (nfs_safe_lstat(lock_path, &st2) < 0) {
M | 887 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 886 |  |
    Source: if (nfs_safe_lstat(lock_path, &st2) < 0) {
    Source: i_error("lstat(%s) failed: %m", lock_path);

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

file_lock_do (38 to 132 file-lock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 128 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: i_assert(fd != -1);
    Source: i_unreached();
M | 128 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: i_assert(fd != -1);
    Source: i_unreached();

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

file_wait_lock (134 to 153 file-lock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 147 | Pointer not checked for null before use : lock | CERT EXP08-C,EXP34-C
| 146 |  |
    Source: lock = i_new(struct file_lock, 1);
    Source: lock->fd = fd;
M | 142 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 647) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FILE-LOCK_647.ref" looking for line -1105
    Source: ret = file_lock_do(fd, path, lock_type, lock_method, timeout_secs);
M | 146 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: ret = file_lock_do(fd, path, lock_type, lock_method, timeout_secs);
    Source: lock = i_new(struct file_lock, 1);

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

file_unlock (161 to 174 file-lock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 173 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 170 |  |
    Source: i_error("file_unlock(%s) failed: %m", lock->path);
    Source: file_lock_free(&lock);
M | 170 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 167 |  |
    Source: if (file_lock_do(lock->fd, lock->path, F_UNLCK,
    Source: i_error("file_unlock(%s) failed: %m", lock->path);
M | 170 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 167 |  |
    Source: if (file_lock_do(lock->fd, lock->path, F_UNLCK,
    Source: i_error("file_unlock(%s) failed: %m", lock->path);

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

file_lock_free (176 to 184 file-lock.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 183 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: i_free(lock->path);
    Source: i_free(lock);
M | 183 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(lock);
M | 183 | Pointer not checked for null before use : (lock)->path | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: i_free(lock->path);
    Source: i_free(lock);
M | 182 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 647) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\FILE-LOCK_647.ref" looking for line -1105
    Source: i_free(lock->path);

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

file_set_size (17 to 78 file-set-size.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: i_assert(size >= 0);
    Source: i_error("fstat() failed: %m");
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: i_assert(size >= 0);
    Source: i_error("fstat() failed: %m");

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

hash2_alloc_table (33 to 39 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_array_init(&hash->hash_table, hash->hash_table_size);
    Source: i_array_init(&hash->hash_table, hash->hash_table_size);
M | 38 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_array_init(&hash->hash_table, hash->hash_table_size);
    Source: (void)array_idx_modifiable(&hash->hash_table, hash->hash_table_size-1);
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 650) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\HASH2_650.ref" looking for line -1105
    Source: i_array_init(&hash->hash_table, hash->hash_table_size);

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

hash2_create (41 to 58 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 57 | Local structure returned in function result : hash |
    Source: return hash;
M | 49 | Pointer not checked for null before use : hash | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: hash = i_new(struct hash2_table, 1);
    Source: hash->initial_size = I_MAX(initial_size, HASH_TABLE_MIN_SIZE);
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: hash->value_pool = pool_alloconly_create("hash2 value pool", 16384);
    Source: hash2_alloc_table(hash, hash->initial_size);
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: hash->value_pool = pool_alloconly_create("hash2 value pool", 16384);
    Source: hash2_alloc_table(hash, hash->initial_size);
M | 48 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 650) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\HASH2_650.ref" looking for line -1105
    Source: hash = i_new(struct hash2_table, 1);

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

hash2_destroy (60 to 68 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 650) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\HASH2_650.ref" looking for line -1105
    Source: i_free(hash);

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

hash2_resize (79 to 111 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 104 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: next = value->next;
    Source: idx = value->key_hash % hash->hash_table_size;
M | 106 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 105 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table, idx);
    Source: value->next = *valuep;
M | 100 | Pointer not checked for null before use : old_hash_table.arr.buffer | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: old_hash_table = hash->hash_table;
    Source: old_hash = array_idx(&old_hash_table, i);
M | 105 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: hash2_alloc_table(hash, next_size);
    Source: valuep = array_idx_modifiable(&hash->hash_table, idx);
M | 105 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: hash2_alloc_table(hash, next_size);
    Source: valuep = array_idx_modifiable(&hash->hash_table, idx);

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

hash2_lookup (113 to 132 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 121 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 120 |  |
    Source: valuep = array_idx(&hash->hash_table, key_hash % hash->hash_table_size);
    Source: value = *valuep;
M | 125 | Pointer not checked for null before use : user_value | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: user_value = value + 1;
    Source: if (hash->key_compare_cb(key, user_value,

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

hash2_iterate (134 to 154 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 143 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: valuep = array_idx(&hash->hash_table,
    Source: iter->next_value = *valuep;

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

hash2_insert_hash (161 to 185 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 184 | Local structure returned in function result : value |
    Source: return value + 1;
M | 169 | Pointer not checked for null before use : value | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: value = hash->deleted_values;
    Source: hash->deleted_values = value->next;
M | 180 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 178 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: value->next = *valuep;
M | 176 | Pointer not checked for null before use : value | CERT EXP08-C,EXP34-C
| 173 |  |
    Source: value = p_malloc(hash->value_pool,
    Source: value->key_hash = key_hash;
M | 178 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 165 |  |
    Source: hash2_resize(hash, TRUE);
    Source: valuep = array_idx_modifiable(&hash->hash_table,
M | 178 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 165 |  |
    Source: hash2_resize(hash, TRUE);
    Source: valuep = array_idx_modifiable(&hash->hash_table,

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

hash2_remove_value_p (187 to 199 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 193 | Pointer not checked for null before use : deleted_value | CERT EXP08-C,EXP34-C
| 192 |  |
    Source: deleted_value = *valuep;
    Source: *valuep = deleted_value->next;

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

hash2_remove (201 to 218 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 212 | Pointer not checked for null before use : hash.count | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: hash2_remove_value_p(hash, valuep);
    Source: hash2_resize(hash, FALSE);
M | 208 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: while (*valuep != NULL) {
M | 217 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: i_panic("hash2_remove(): key not found");
M | 217 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: i_panic("hash2_remove(): key not found");

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

hash2_remove_iter (220 to 238 hash2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 232 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 228 |  |
    Source: next = (*valuep)->next;
    Source: iter->next_value = next;
M | 226 | Pointer not checked for null before use : valuep | CERT EXP08-C,EXP34-C
| 224 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: while (*valuep != NULL) {
M | 237 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 224 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: i_panic("hash2_remove_value(): key/value not found");
M | 237 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 224 |  |
    Source: valuep = array_idx_modifiable(&hash->hash_table,
    Source: i_panic("hash2_remove_value(): key/value not found");

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

hash_table_create (52 to 71 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 70 | Local structure returned in function result : table |
    Source: return table;
M | 59 | Pointer not checked for null before use : table | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: table = p_new(table_pool, struct hash_table, 1);
    Source: table->table_pool = table_pool;

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

free_node (73 to 80 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 78 | Attempt to use already freed object. | CERT MEM31-C
    Source: node->next = table->free_nodes;
M | 79 | Attempt to use already freed object. | CERT MEM31-C
    Source: table->free_nodes = node;
M | 78 | Pointer not checked for null before use : node | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: p_free(table->node_pool, node);
    Source: node->next = table->free_nodes;
M | 78 | Attempt to read from freed memory. : node | CERT MEM30-C
    Source: node->next = table->free_nodes;

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

destroy_node_list (83 to 92 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 88 |  |
    Source: next = node->next;
    Source: node = next;
M | 89 | Attempt to read from freed memory. : node | CERT MEM30-C
    Source: p_free(table->node_pool, node);

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

hash_table_destroy (104 to 117 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 116 | Pointer not checked for null before use : (table)->table_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: p_free(table->table_pool, table->nodes);
    Source: p_free(table->table_pool, table);
M | 116 | Pointer not checked for null before use : (table)->nodes | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: p_free(table->table_pool, table->nodes);
    Source: p_free(table->table_pool, table);

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

hash_table_clear (119 to 134 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 130 | Attempt to use already freed object. | CERT MEM31-C
    Source: memset(table->nodes, 0, sizeof(struct hash_node) * table->size);

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

hash_table_insert_node (181 to 258 hash.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 197 | Local structure returned in function result : node |
    Source: return node;
M | 210 | Local structure returned in function result : node |
    Source: return node;
M | 216 | Local structure returned in function result : node |
    Source: return node;
M | 229 | Local structure returned in function result : node |
    Source: return node;
M | 257 | Local structure returned in function result : node |
    Source: return node;
M | 250 | Pointer not checked for null before use : prev | CERT EXP08-C,EXP34-C
| 221 |  |
    Source: prev = node; node = node->next;
    Source: prev->next = node;
M | 250 | Pointer not checked for null before use : node | CERT EXP08-C,EXP34-C
| 244 |  |
    Source: node = p_new(table->node_pool, struct hash_node, 1);
    Source: prev->next = node;
M | 247 | Pointer not checked for null before use : node | CERT EXP08-C,EXP34-C
| 246 |  |
    Source: node = table->free_nodes;
    Source: table->free_nodes = node->next;
M | 240 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 238 |  |
    Source: if (table->frozen == 0 && hash_table_resize(table, TRUE)) {
    Source: return hash_table_insert_node(table, key, value, FALSE);
M | 238 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 188 |  |
    Source: i_assert(key != NULL);
    Source: if (table->frozen == 0 && hash_table_resize(table, TRUE)) {
M | 240 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 238 |  |
    Source: if (table->frozen == 0 && hash_table_resize(table, TRUE)) {
    Source: return hash_table_insert_node(table, key, value, FALSE);
M | 238 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 188 |  |
    Source: i_assert(key != NULL);
    Source: if (table->frozen == 0 && hash_table_resize(table, TRUE)) {
M | 248 | Procedure contains UR data flow anomalies. : dest.next | CERT EXP33-C
    Source: node->next = NULL;
M | 248 | Procedure contains UR data flow anomalies. : table.next | CERT EXP33-C
    Source: node->next = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
hash.c | 248 | hash.c | 240 | table.next
    Source: node->next = NULL;
    Source: return hash_table_insert_node(table, key, value, FALSE);

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

hash_table_insert (260 to 266 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 265 | Pointer not checked for null before use : node | CERT EXP08-C,EXP34-C
| 264 |  |
    Source: node = hash_table_insert_node(table, key, value, TRUE);
    Source: node->key = key;

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

hash_table_compress (273 to 296 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 282 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 280 |  |
    Source: next = node->next;
    Source: if (next->key == NULL) {
M | 293 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 292 |  |
    Source: next = root->next;
    Source: *root = *next;
M | 294 | Pointer not checked for null before use : (table)->node_pool | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: free_node(table, next);
    Source: free_node(table, next);
M | 296 | Memory not freed after last reference. : next | CERT MEM00-C
    Source: }
M | 284 | Attempt to read from freed memory. : next | CERT MEM30-C
    Source: free_node(table, next);

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

hash_table_remove (308 to 326 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 325 | Pointer not checked for null before use : table.free_nodes | CERT EXP08-C,EXP34-C
| 324 |  |
    Source: else if (!hash_table_resize(table, FALSE))
    Source: hash_table_compress(table, &table->nodes[hash % table->size]);
M | 325 | Pointer not checked for null before use : table.node_pool | CERT EXP08-C,EXP34-C
| 324 |  |
    Source: else if (!hash_table_resize(table, FALSE))
    Source: hash_table_compress(table, &table->nodes[hash % table->size]);
M | 324 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 317 |  |
    Source: i_panic("key not found from hash");
    Source: else if (!hash_table_resize(table, FALSE))
M | 324 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 317 |  |
    Source: i_panic("key not found from hash");
    Source: else if (!hash_table_resize(table, FALSE))

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

hash_table_iterate_init (333 to 343 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 342 | Local structure returned in function result : ctx |
    Source: return ctx;
M | 340 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: ctx = i_new(struct hash_iterate_context, 1);
    Source: ctx->table = table;
M | 339 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 649) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\HASH_649.ref" looking for line -1105
    Source: ctx = i_new(struct hash_iterate_context, 1);

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

hash_table_iterate_next (345 to 361 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 352 | Attempt to use already freed object. | CERT MEM31-C
    Source: if (++ctx->pos == ctx->table->size) {
M | 356 | Attempt to use already freed object. | CERT MEM31-C
    Source: node = &ctx->table->nodes[ctx->pos];

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

hash_table_iterate (363 to 380 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 375 | Pointer not checked for null before use : node | CERT EXP08-C,EXP34-C
| 370 |  |
    Source: node = hash_table_iterate_next(ctx, node);
    Source: *key_r = node->key;
M | 378 | Pointer not checked for null before use : ctx.pos | CERT EXP08-C,EXP34-C
| 370 |  |
    Source: node = hash_table_iterate_next(ctx, node);
    Source: ctx->next = hash_table_iterate_next(ctx, node);

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

hash_table_iterate_deinit (382 to 389 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 388 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 387 |  |
    Source: hash_table_thaw(ctx->table);
    Source: i_free(ctx);
M | 387 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 649) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\HASH_649.ref" looking for line -1105
    Source: hash_table_thaw(ctx->table);

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

hash_table_thaw (396 to 407 hash.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 405 | Pointer not checked for null before use : table.nodes | CERT EXP08-C,EXP34-C
| 404 |  |
    Source: if (!hash_table_resize(table, FALSE))
    Source: hash_table_compress_removed(table);
M | 405 | Pointer not checked for null before use : table.free_nodes | CERT EXP08-C,EXP34-C
| 404 |  |
    Source: if (!hash_table_resize(table, FALSE))
    Source: hash_table_compress_removed(table);
M | 405 | Pointer not checked for null before use : table.node_pool | CERT EXP08-C,EXP34-C
| 404 |  |
    Source: if (!hash_table_resize(table, FALSE))
    Source: hash_table_compress_removed(table);
M | 404 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 398 |  |
    Source: i_assert(table->frozen > 0);
    Source: if (!hash_table_resize(table, FALSE))
M | 404 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 398 |  |
    Source: i_assert(table->frozen > 0);
    Source: if (!hash_table_resize(table, FALSE))

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

hash_table_resize (409 to 462 hash.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 429 | Attempt to use already freed object. | CERT MEM31-C
    Source: old_nodes = table->nodes;
M | 432 | Attempt to use already freed object. | CERT MEM31-C
    Source: table->nodes = p_new(table->table_pool, struct hash_node, table->size);
M | 441 | Pointer not checked for null before use : old_nodes | CERT EXP08-C,EXP34-C
| 429 |  |
    Source: old_nodes = table->nodes;
    Source: node = &old_nodes[i];
M | 451 | Pointer not checked for null before use : (table)->table_pool | CERT EXP08-C,EXP34-C
| 443 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: hash_table_insert_node(table, node->key,
M | 451 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 443 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: hash_table_insert_node(table, node->key,
M | 451 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 443 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: hash_table_insert_node(table, node->key,
M | 451 | Pointer not checked for null before use : table.key | CERT EXP08-C,EXP34-C
| 443 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: hash_table_insert_node(table, node->key,
M | 451 | Pointer not checked for null before use : table.next | CERT EXP08-C,EXP34-C
| 443 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: hash_table_insert_node(table, node->key,
M | 454 | Pointer not checked for null before use : table.free_nodes | CERT EXP08-C,EXP34-C
| 451 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: free_node(table, node);
M | 454 | Pointer not checked for null before use : table.node_pool | CERT EXP08-C,EXP34-C
| 451 |  |
    Source: hash_table_insert_node(table, node->key,
    Source: free_node(table, node);
M | 450 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 448 |  |
    Source: next = node->next;
    Source: if (node->key != NULL) {

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
hash.c | 248 | hash.c | 451 | table.next
    Source: node->next = NULL;
    Source: hash_table_insert_node(table, node->key,

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

hash_table_copy (464 to 477 hash.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 474 | Pointer not checked for null before use : iter | CERT EXP08-C,EXP34-C
| 471 |  |
    Source: iter = hash_table_iterate_init(src);
    Source: hash_table_iterate_deinit(&iter);
M | 473 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 472 |  |
    Source: while (hash_table_iterate(iter, &key, &value))
    Source: hash_table_insert(dest, key, value);
M | 473 | Pointer not checked for null before use : value | CERT EXP08-C,EXP34-C
| 472 |  |
    Source: while (hash_table_iterate(iter, &key, &value))
    Source: hash_table_insert(dest, key, value);
M | 474 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_iterate_deinit(&iter);
M | 476 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.nodes | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.key | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.nodes_count | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.value | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.next | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.free_nodes | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.node_pool | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : dest.table_pool | CERT EXP08-C,EXP34-C
| 473 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_thaw(dest);
M | 476 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 474 |  |
    Source: hash_table_iterate_deinit(&iter);
    Source: hash_table_thaw(dest);
M | 474 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 473 |  |
    Source: hash_table_insert(dest, key, value);
    Source: hash_table_iterate_deinit(&iter);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
hash.c | 248 | hash.c | 476 | dest.next
    Source: node->next = NULL;
    Source: hash_table_thaw(dest);

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

binary_to_hex_case (7 to 27 hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 22 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: p = dest;
    Source: *p++ = value < 10 ? value + '0' : value - 10 + base_char;

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

binary_to_hex (29 to 36 hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 33 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: unsigned char *dest = t_malloc(size * 2 + 1);
    Source: binary_to_hex_case(dest, data, size, FALSE);

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

binary_to_hex_ucase (38 to 45 hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 42 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: unsigned char *dest = t_malloc(size * 2 + 1);
    Source: binary_to_hex_case(dest, data, size, TRUE);

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

binary_to_hex_append (47 to 54 hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 53 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: buf = buffer_append_space_unsafe(dest, size * 2);
    Source: binary_to_hex_case(buf, data, size, FALSE);

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

hmac_md5_get_cram_context (56 to 76 hmac-md5.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 61 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define CDPUT(p, c) STMT_START {   \

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

hmac_md5_set_cram_context (78 to 101 hmac-md5.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 83 | Macro parameter not in brackets. | CERT PRE01-C,PRE02-C
    Source: #define CDGET(p, c) STMT_START { \
M | 83 | Macro replacement list needs parentheses. | CERT PRE02-C
    Source: #define CDGET(p, c) STMT_START { \

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

home_try_expand (9 to 43 home-expand.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 19 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: path++;
    Source: if (*path == '/' || *path == '\0') {
M | 32 | Pointer not checked for null before use : pw | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: pw = getpwnam(t_strdup_until(path, p));
    Source: home = pw == NULL ? NULL : pw->pw_dir;
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: pw = getpwnam(t_strdup_until(path, p));
    Source: *_path = t_strconcat(home, "/", path, NULL);
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: pw = getpwnam(t_strdup_until(path, p));
    Source: *_path = t_strconcat(home, "/", path, NULL);
M | 12 | Procedure contains UR data flow anomalies. : p | CERT EXP33-C
| 38 |  |
    Source: if (*path == '\0')
    Source: const char *home, *p;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
home-expand.c | 12 | home-expand.c | 38 | p
    Source: const char *home, *p;
    Source: if (*path == '\0')

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

hostpid_init (14 to 31 hostpid.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 27 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free_and_null(my_domain);
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: i_free_and_null(my_domain);
    Source: i_strocpy(pid, dec2str(getpid()), sizeof(pid));
M | 29 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_strocpy(pid, dec2str(getpid()), sizeof(pid));
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: i_fatal("Invalid system hostname: %s", hostname);
    Source: i_free_and_null(my_domain);
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: i_fatal("Invalid system hostname: %s", hostname);
    Source: i_strocpy(pid, dec2str(getpid()), sizeof(pid));

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

my_hostdomain (33 to 48 hostpid.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 38 | Attempt to use already freed object. | CERT MEM31-C
    Source: if (my_domain == NULL) {
M | 40 | Pointer not checked for null before use : hent | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: hent = gethostbyname(my_hostname);
    Source: name = hent != NULL ? hent->h_name : NULL;
M | 45 | Pointer not checked for null before use : name | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: name = my_hostname;
    Source: my_domain = i_strdup(name);

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

i_strdup (17 to 20 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 19 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: return p_strdup(default_pool, str);
M | 19 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: return p_strdup(default_pool, str);

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

i_strdup_empty (22 to 25 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 24 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: return p_strdup_empty(default_pool, str);
M | 24 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: return p_strdup_empty(default_pool, str);

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

i_strdup_until (27 to 30 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: return p_strdup_until(default_pool, str, end);
M | 29 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: return p_strdup_until(default_pool, str, end);

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

i_strndup (32 to 35 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: return p_strndup(default_pool, str, max_chars);
M | 34 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: return p_strndup(default_pool, str, max_chars);

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

i_strdup_printf (37 to 46 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 43 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: ret = p_strdup_vprintf(default_pool, format, args);
M | 43 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: ret = p_strdup_vprintf(default_pool, format, args);

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

i_strdup_vprintf (48 to 51 imem.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 50 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: return p_strdup_vprintf(default_pool, format, args);
M | 50 | Pointer not checked for null before use : static_system_pool.v | CERT EXP08-C,EXP34-C
| 54 (mempool.h) |  |
    Source: extern pool_t system_clean_pool;
    Source: return p_strdup_vprintf(default_pool, format, args);

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

i_strconcat (53 to 75 imem.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 62 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 61 |  |
    Source: T_BEGIN {
    Source: const char *temp = vstrconcat(str1, args, &len);
M | 62 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 61 |  |
    Source: T_BEGIN {
    Source: const char *temp = vstrconcat(str1, args, &len);
M | 68 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: t_buffer_alloc(len);
    Source: ret = p_malloc(default_pool, len);
M | 61 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 656) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IMEM_656.ref" looking for line -1105
    Source: T_BEGIN {
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: const char *temp = vstrconcat(str1, args, &len);
    Source: } T_END;
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: const char *temp = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: t_buffer_alloc(len);
    Source: } T_END;
M | 67 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: const char *temp = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 65 | Procedure contains UR data flow anomalies. : ret | CERT EXP33-C
| 56 |  |
    Source: char *ret;
    Source: ret = NULL;
M | 57 | Procedure contains UR data flow anomalies. : len | CERT EXP33-C
| 67 |  |
    Source: t_buffer_alloc(len);
    Source: size_t len;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
imem.c | 65 | imem.c | 74 | ret
    Source: ret = NULL;
    Source: return ret;
imem.c | 57 | imem.c | 67 | len
    Source: size_t len;
    Source: t_buffer_alloc(len);

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

io_loop_handler_init (28 to 47 ioloop-epoll.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: ioloop->handler_context = ctx = i_new(struct ioloop_handler_context, 1);
    Source: i_array_init(&ctx->events, initial_fd_count);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: i_array_init(&ctx->events, initial_fd_count);
    Source: i_array_init(&ctx->events, initial_fd_count);
M | 35 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: i_array_init(&ctx->events, initial_fd_count);
    Source: i_array_init(&ctx->fd_index, initial_fd_count);
M | 35 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_array_init(&ctx->fd_index, initial_fd_count);
    Source: i_array_init(&ctx->fd_index, initial_fd_count);
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 657) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-EPOLL_657.ref" looking for line -1105
    Source: ioloop->handler_context = ctx = i_new(struct ioloop_handler_context, 1);
M | 46 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: i_fatal("epoll_create(): %m (you may need to increase "
    Source: fd_close_on_exec(ctx->epfd, TRUE);
M | 46 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_array_init(&ctx->fd_index, initial_fd_count);
    Source: fd_close_on_exec(ctx->epfd, TRUE);
M | 42 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_array_init(&ctx->fd_index, initial_fd_count);
    Source: i_fatal("epoll_create(): %m (you may need to increase "

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

io_loop_handler_deinit (49 to 64 ioloop-epoll.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 57 | Pointer not checked for null before use : list | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: list = array_get_modifiable(&ctx->fd_index, &count);
    Source: i_free(list[i]);
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: i_error("close(epoll) failed: %m");
    Source: i_free(ioloop->handler_context);
M | 57 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(list[i]);

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

io_loop_handle_add (92 to 129 ioloop-epoll.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 94 | Attempt to use already freed object. | CERT MEM31-C
    Source: struct ioloop_handler_context *ctx = io->io.ioloop->handler_context;
M | 101 | Pointer not checked for null before use : list | CERT EXP08-C,EXP34-C
| 100 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: if (*list == NULL)
M | 100 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 657) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-EPOLL_657.ref" looking for line -1105
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
M | 102 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 100 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: *list = i_new(struct io_list, 1);
M | 104 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 100 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: first = ioloop_iolist_add(*list, io);
M | 117 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: i_fatal("epoll_ctl(add, %d) failed: %m "
    Source: i_panic("epoll_ctl(%s, %d) failed: %m",
M | 104 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 100 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: first = ioloop_iolist_add(*list, io);
M | 117 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: i_fatal("epoll_ctl(add, %d) failed: %m "
    Source: i_panic("epoll_ctl(%s, %d) failed: %m",

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

io_loop_handle_remove (131 to 161 ioloop-epoll.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 133 | Attempt to use already freed object. | CERT MEM31-C
    Source: struct ioloop_handler_context *ctx = io->io.ioloop->handler_context;
M | 140 | Pointer not checked for null before use : list | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: last = ioloop_iolist_del(*list, io);
M | 139 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 657) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-EPOLL_657.ref" looking for line -1105
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
M | 160 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: i_free(io);
M | 150 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: i_error("epoll_ctl(%s, %d) failed: %m",
M | 150 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: list = array_idx_modifiable(&ctx->fd_index, io->fd);
    Source: i_error("epoll_ctl(%s, %d) failed: %m",

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

io_loop_handler_run (163 to 223 ioloop-epoll.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 165 | Attempt to use already freed object. | CERT MEM31-C
    Source: struct ioloop_handler_context *ctx = ioloop->handler_context;
M | 179 | Pointer not checked for null before use : events | CERT EXP08-C,EXP34-C
| 178 |  |
    Source: events = array_get_modifiable(&ctx->events, &events_count);
    Source: ret = epoll_wait(ctx->epfd, events, events_count, msecs);
M | 193 | Pointer not checked for null before use : event | CERT EXP08-C,EXP34-C
| 192 |  |
    Source: event = array_idx(&ctx->events, i);
    Source: list = event->data.ptr;
M | 213 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: t_id = t_push();
    Source: if (t_pop() != t_id) {
M | 213 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: t_id = t_push();
    Source: if (t_pop() != t_id) {
M | 196 | Pointer not checked for null before use : list | CERT EXP08-C,EXP34-C
| 193 |  |
    Source: list = event->data.ptr;
    Source: io = list->ios[j];
M | 184 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 181 |  |
    Source: i_fatal("epoll_wait(): %m");
    Source: io_loop_handle_timeouts(ioloop);
M | 214 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 213 |  |
    Source: if (t_pop() != t_id) {
    Source: i_panic("Leaked a t_pop() call in "
M | 211 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 214 |  |
    Source: i_panic("Leaked a t_pop() call in "
    Source: t_id = t_push();
M | 184 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 181 |  |
    Source: i_fatal("epoll_wait(): %m");
    Source: io_loop_handle_timeouts(ioloop);
M | 214 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 213 |  |
    Source: if (t_pop() != t_id) {
    Source: i_panic("Leaked a t_pop() call in "
M | 211 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 214 |  |
    Source: i_panic("Leaked a t_pop() call in "
    Source: t_id = t_push();
M | 170 | Procedure contains UR data flow anomalies. : tv | CERT EXP33-C
| 176 |  |
    Source: msecs = io_loop_get_wait_time(ioloop, &tv);
    Source: struct timeval tv;

Code | Line | Violation | Standard
--- | --- | --- | ---

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
ioloop-epoll.c | 170 | ioloop-epoll.c | 176 | tv
    Source: struct timeval tv;
    Source: msecs = io_loop_get_wait_time(ioloop, &tv);

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

ioloop_iolist_add (11 to 35 ioloop-iolist.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 25 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: i_unreached();
    Source: i_assert(list->ios[idx] == NULL);
M | 25 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: i_unreached();
    Source: i_assert(list->ios[idx] == NULL);
M | 13 | Procedure contains UR data flow anomalies. : idx | CERT EXP33-C
| 25 |  |
    Source: i_assert(list->ios[idx] == NULL);
    Source: int i, idx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
ioloop-iolist.c | 13 | ioloop-iolist.c | 25 | idx
    Source: int i, idx;
    Source: i_assert(list->ios[idx] == NULL);

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

io_notify_fd_add (9 to 27 ioloop-notify-fd.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 15 | Pointer not checked for null before use : io | CERT EXP08-C,EXP34-C
| 14 |  |
    Source: io = i_new(struct io_notify, 1);
    Source: io->io.condition = IO_NOTIFY;
M | 14 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 661) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-NOTIFY-FD_661.ref" looking for line -1105
    Source: io = i_new(struct io_notify, 1);
M | 18 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| Ref. Line -1706 (Module 661) |  |
    Ref(-1706)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-NOTIFY-FD_661.ref" looking for line -1706
    Source: io->io.ioloop = current_ioloop;

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

io_notify_fd_find (42 to 53 ioloop-notify-fd.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 49 | Local structure returned in function result : io |
    Source: return io;

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

inotify_input_more (34 to 78 ioloop-notify-inotify.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 62 | User input not checked before use. : event_buf | CERT FIO30-C
| 45 |  |
    Source: ret = read(ctx->inotify_fd, event_buf, sizeof(event_buf));
    Source: event = (struct inotify_event *)(event_buf + pos);
M | 55 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("read(inotify) failed: %m");
    Source: i_fatal("gettimeofday(): %m");
M | 76 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: i_error("read(inotify) returned partial event");
M | 55 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("read(inotify) failed: %m");
    Source: i_fatal("gettimeofday(): %m");
M | 76 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: i_error("read(inotify) returned partial event");

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

io_add_notify (86 to 127 ioloop-notify-inotify.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 89 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| Ref. Line -1706 (Module 662) |  |
    Ref(-1706)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-NOTIFY-INOTIFY_662.ref" looking for line -1706
    Source: struct ioloop_notify_handler_context *ctx =
M | 97 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ctx = io_loop_notify_handler_init();
    Source: if (ctx->disabled)
M | 121 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ctx = io_loop_notify_handler_init();
    Source: ctx->event_io = io_add(ctx->inotify_fd, IO_READ,
M | 125 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ctx = io_loop_notify_handler_init();
    Source: *io_r = io_notify_fd_add(&ctx->fd_ctx, wd, callback, context);

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

io_loop_notify_remove (129 to 147 ioloop-notify-inotify.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 146 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: io_notify_fd_free(&ctx->fd_ctx, io);
    Source: io_remove(&ctx->event_io);
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_error("inotify_rm_watch() failed: %m");
    Source: io_notify_fd_free(&ctx->fd_ctx, io);
M | 146 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_error("inotify_rm_watch() failed: %m");
    Source: io_remove(&ctx->event_io);
M | 147 | Memory not freed after last reference. : io | CERT MEM00-C
    Source: }

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

io_loop_notify_handler_init (149 to 172 ioloop-notify-inotify.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 171 | Local structure returned in function result : ctx |
    Source: return ctx;
M | 157 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 154 |  |
    Source: ctx = ioloop->notify_handler_context =
    Source: ctx->inotify_fd = inotify_init();
M | 169 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: fd_close_on_exec(ctx->inotify_fd, TRUE);
    Source: fd_set_nonblock(ctx->inotify_fd, TRUE);
M | 169 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: fd_close_on_exec(ctx->inotify_fd, TRUE);
    Source: fd_set_nonblock(ctx->inotify_fd, TRUE);
M | 154 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| Ref. Line -1706 (Module 662) |  |
    Ref(-1706)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-NOTIFY-INOTIFY_662.ref" looking for line -1706
    Source: ctx = ioloop->notify_handler_context =
M | 155 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 662) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP-NOTIFY-INOTIFY_662.ref" looking for line -1105
    Source: i_new(struct ioloop_notify_handler_context, 1);

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

io_loop_notify_handler_deinit (174 to 185 ioloop-notify-inotify.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 184 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 181 |  |
    Source: i_error("close(inotify) failed: %m");
    Source: i_free(ctx);

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

io_add (30 to 57 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 40 | Pointer not checked for null before use : io | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: io = i_new(struct io_file, 1);
    Source: io->io.condition = condition;
M | 39 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_assert((condition & IO_NOTIFY) == 0);
    Source: io = i_new(struct io_file, 1);
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: io_loop_initialize_handler(io->io.ioloop);
    Source: io_loop_handle_add(io);
M | 36 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(callback != NULL);
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: i_assert(callback != NULL);
    Source: i_assert((condition & IO_NOTIFY) == 0);
M | 43 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_assert((condition & IO_NOTIFY) == 0);
    Source: io->io.ioloop = current_ioloop;
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: io_loop_initialize_handler(io->io.ioloop);
    Source: io_loop_handle_add(io);
M | 36 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(callback != NULL);
M | 37 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: i_assert(callback != NULL);
    Source: i_assert((condition & IO_NOTIFY) == 0);

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

io_remove_full (75 to 95 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 93 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: i_assert(io->callback != NULL);
    Source: io_loop_handle_remove(io_file, closed);
M | 93 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: i_assert(io->callback != NULL);
    Source: io_loop_handle_remove(io_file, closed);
M | 94 | Memory not freed after last reference. : io_file | CERT MEM00-C
    Source: }

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

io_remove_closed (102 to 107 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 106 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: i_assert(((*io)->condition & IO_NOTIFY) == 0);
    Source: io_remove_full(io, TRUE);
M | 106 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: i_assert(((*io)->condition & IO_NOTIFY) == 0);
    Source: io_remove_full(io, TRUE);

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

timeout_add (133 to 149 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 148 | Local structure returned in function result : timeout |
    Source: return timeout;
M | 139 | Pointer not checked for null before use : timeout | CERT EXP08-C,EXP34-C
| 138 |  |
    Source: timeout = i_new(struct timeout, 1);
    Source: timeout->msecs = msecs;
M | 138 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 667) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP_667.ref" looking for line -1105
    Source: timeout = i_new(struct timeout, 1);
M | 140 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| Ref. Line -1706 (Module 667) |  |
    Ref(-1706)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP_667.ref" looking for line -1706
    Source: timeout->ioloop = current_ioloop;
M | 147 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 145 |  |
    Source: timeout_update_next(timeout, timeout->ioloop->running ?
    Source: priorityq_add(timeout->ioloop->timeouts, &timeout->item);
M | 147 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 145 |  |
    Source: timeout_update_next(timeout, timeout->ioloop->running ?
    Source: priorityq_add(timeout->ioloop->timeouts, &timeout->item);

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

timeout_remove (151 to 158 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 157 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
    Source: i_free(timeout);
M | 156 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 667) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP_667.ref" looking for line -1105
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);

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

timeout_reset_timeval (160 to 181 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 180 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 179 |  |
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
    Source: priorityq_add(timeout->ioloop->timeouts, &timeout->item);
M | 180 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 179 |  |
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
    Source: priorityq_add(timeout->ioloop->timeouts, &timeout->item);
M | 179 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 175 |  |
    Source: i_assert(tv_now == NULL ||
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);
M | 179 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 175 |  |
    Source: i_assert(tv_now == NULL ||
    Source: priorityq_remove(timeout->ioloop->timeouts, &timeout->item);

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

timeout_get_wait_time (189 to 223 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 202 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 201 |  |
    Source: i_assert(tv_r->tv_sec > 0);
    Source: i_assert(timeout->next_run.tv_sec > 0);
M | 201 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: i_assert(tv_r->tv_sec > 0);
M | 221 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: i_assert(timeout->next_run.tv_sec > 0);
    Source: i_assert(ret > 0 && tv_r->tv_sec >= 0 && tv_r->tv_usec >= 0);
M | 202 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 201 |  |
    Source: i_assert(tv_r->tv_sec > 0);
    Source: i_assert(timeout->next_run.tv_sec > 0);
M | 201 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: i_assert(tv_r->tv_sec > 0);
M | 221 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: i_assert(timeout->next_run.tv_sec > 0);
    Source: i_assert(ret > 0 && tv_r->tv_sec >= 0 && tv_r->tv_usec >= 0);

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

io_loop_get_wait_time (225 to 246 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 233 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 232 |  |
    Source: item = priorityq_peek(ioloop->timeouts);
    Source: timeout = (struct timeout *)item;

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

io_loop_timeouts_update (263 to 275 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 271 | Pointer not checked for null before use : items | CERT EXP08-C,EXP34-C
| 269 |  |
    Source: items = priorityq_items(ioloop->timeouts);
    Source: struct timeout *to = (struct timeout *)items[i];

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

io_loops_timeouts_update (277 to 283 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 281 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| Ref. Line -1706 (Module 667) |  |
    Ref(-1706)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\IOLOOP_667.ref" looking for line -1706
    Source: for (ioloop = current_ioloop; ioloop != NULL; ioloop = ioloop->prev)

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

io_loop_handle_timeouts_real (285 to 334 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 327 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 325 |  |
    Source: timeout_reset_timeval(timeout, &tv_call);
    Source: t_id = t_push();
M | 327 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 325 |  |
    Source: timeout_reset_timeval(timeout, &tv_call);
    Source: t_id = t_push();
M | 329 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: t_id = t_push();
    Source: if (t_pop() != t_id) {
M | 329 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: t_id = t_push();
    Source: if (t_pop() != t_id) {
M | 325 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 321 |  |
    Source: if (timeout_get_wait_time(timeout, &tv, &tv_call) > 0)
    Source: timeout_reset_timeval(timeout, &tv_call);
M | 330 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: if (t_pop() != t_id) {
    Source: i_panic("Leaked a t_pop() call in timeout handler %p",
M | 321 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 330 |  |
    Source: i_panic("Leaked a t_pop() call in timeout handler %p",
    Source: if (timeout_get_wait_time(timeout, &tv, &tv_call) > 0)
M | 303 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 292 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: i_fatal("gettimeofday(): %m");
M | 325 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 321 |  |
    Source: if (timeout_get_wait_time(timeout, &tv, &tv_call) > 0)
    Source: timeout_reset_timeval(timeout, &tv_call);
M | 330 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: if (t_pop() != t_id) {
    Source: i_panic("Leaked a t_pop() call in timeout handler %p",
M | 297 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 292 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: io_loops_timeouts_update(-(long)(ioloop_time -
M | 321 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 330 |  |
    Source: i_panic("Leaked a t_pop() call in timeout handler %p",
    Source: if (timeout_get_wait_time(timeout, &tv, &tv_call) > 0)
M | 306 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 292 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_fatal("gettimeofday(): %m");
    Source: io_loops_timeouts_update(ioloop_timeval.tv_sec -

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

io_loop_handle_timeouts (336 to 341 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 339 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 338 |  |
    Source: T_BEGIN {
    Source: io_loop_handle_timeouts_real(ioloop);
M | 339 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 338 |  |
    Source: T_BEGIN {
    Source: io_loop_handle_timeouts_real(ioloop);
M | 340 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: io_loop_handle_timeouts_real(ioloop);
    Source: } T_END;
M | 340 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: io_loop_handle_timeouts_real(ioloop);
    Source: } T_END;

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

io_loop_run (343 to 351 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 350 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 346 |  |
    Source: io_loop_initialize_handler(ioloop);
    Source: io_loop_handler_run(ioloop);
M | 350 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 346 |  |
    Source: io_loop_initialize_handler(ioloop);
    Source: io_loop_handler_run(ioloop);

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

io_loop_create (373 to 393 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 392 | Local structure returned in function result : ioloop |
    Source: return ioloop;
M | 383 | Pointer not checked for null before use : ioloop | CERT EXP08-C,EXP34-C
| 382 |  |
    Source: ioloop = i_new(struct ioloop, 1);
    Source: ioloop->timeouts = priorityq_init(timeout_cmp, 32);
M | 385 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 383 |  |
    Source: ioloop->timeouts = priorityq_init(timeout_cmp, 32);
    Source: ioloop->time_moved_callback = current_ioloop != NULL ?
M | 382 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 379 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: ioloop = i_new(struct ioloop, 1);
M | 383 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 379 |  |
    Source: i_fatal("gettimeofday(): %m");
    Source: ioloop->timeouts = priorityq_init(timeout_cmp, 32);

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

io_loop_destroy (395 to 429 ioloop.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 428 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(ioloop);
M | 428 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 425 |  |
    Source: i_assert(ioloop == current_ioloop);
    Source: i_free(ioloop);
M | 413 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 417 |  |
    Source: i_free(to);
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
M | 416 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 413 |  |
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
    Source: i_warning("Timeout leak: %p", (void *)to->callback);
M | 419 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 413 |  |
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
    Source: priorityq_deinit(&ioloop->timeouts);
M | 422 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 419 |  |
    Source: priorityq_deinit(&ioloop->timeouts);
    Source: io_loop_handler_deinit(ioloop);
M | 413 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
M | 426 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 425 |  |
    Source: i_assert(ioloop == current_ioloop);
    Source: current_ioloop = current_ioloop->prev;
M | 413 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 416 |  |
    Source: i_warning("Timeout leak: %p", (void *)to->callback);
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
M | 416 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 413 |  |
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
    Source: i_warning("Timeout leak: %p", (void *)to->callback);
M | 422 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 413 |  |
    Source: while ((item = priorityq_pop(ioloop->timeouts)) != NULL) {
    Source: io_loop_handler_deinit(ioloop);
M | 410 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 409 |  |
    Source: i_warning("I/O leak: %p (%d)", (void *)io->io.callback, io->fd);
    Source: io_remove(&_io);
M | 410 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 409 |  |
    Source: i_warning("I/O leak: %p (%d)", (void *)io->io.callback, io->fd);
    Source: io_remove(&_io);
M | 417 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 416 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_warning("Timeout leak: %p", (void *)to->callback);
    Source: i_free(to);

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

io_stream_unref (26 to 39 iostream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 38 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_free(stream->name);
    Source: i_free(stream);
M | 38 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(stream);
M | 38 | Pointer not checked for null before use : (stream)->name | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: i_free(stream->name);
    Source: i_free(stream);
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: i_assert(stream->refcount > 0);
    Source: i_free(stream->name);

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

i_stream_concat_read_next (48 to 78 istream-concat.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 75 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: data = i_stream_get_data(cstream->cur_input, &data_size);
    Source: memcpy(cstream->istream.w_buffer, data, data_size);
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
    Source: i_unreached();
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_unreached();
    Source: i_assert(size >= data_size);
M | 70 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: i_assert(cstream->cur_input->eof);
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
    Source: i_unreached();
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_unreached();
    Source: i_assert(size >= data_size);
M | 70 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: i_assert(cstream->cur_input->eof);
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
M | 51 | Procedure contains UR data flow anomalies. : size | CERT EXP33-C
| 70 |  |
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))
    Source: size_t data_size, size;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream-concat.c | 51 | istream-concat.c | 70 | size
    Source: size_t data_size, size;
    Source: if (!i_stream_get_buffer_space(&cstream->istream, data_size, &size))

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

i_stream_concat_read (80 to 168 istream-concat.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 146 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: data = i_stream_get_data(cstream->cur_input, &pos);
    Source: stream->buffer = data;
M | 119 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_assert(cur_pos == pos);
    Source: ret = i_stream_read(cstream->cur_input);
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: i_assert(stream->skip >= cstream->prev_skip);
    Source: i_assert(cstream->prev_skip == 0);
M | 153 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: i_assert(ret != -1 || stream->istream.eof);
    Source: if (!i_stream_get_buffer_space(stream, pos - cur_pos, &size))
M | 135 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 119 |  |
    Source: ret = i_stream_read(cstream->cur_input);
    Source: i_stream_concat_read_next(cstream);
M | 119 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_assert(cur_pos == pos);
    Source: ret = i_stream_read(cstream->cur_input);
M | 98 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: i_assert(stream->skip >= cstream->prev_skip);
    Source: i_assert(cstream->prev_skip == 0);
M | 153 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: i_assert(ret != -1 || stream->istream.eof);
    Source: if (!i_stream_get_buffer_space(stream, pos - cur_pos, &size))
M | 135 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 119 |  |
    Source: ret = i_stream_read(cstream->cur_input);
    Source: i_stream_concat_read_next(cstream);
M | 137 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: i_stream_concat_read_next(cstream);
    Source: return i_stream_concat_read(stream);
M | 137 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: i_stream_concat_read_next(cstream);
    Source: return i_stream_concat_read(stream);
M | 84 | Procedure contains UR data flow anomalies. : size | CERT EXP33-C
| 153 |  |
    Source: if (!i_stream_get_buffer_space(stream, pos - cur_pos, &size))
    Source: size_t size, pos, cur_pos, bytes_skipped;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream-concat.c | 84 | istream-concat.c | 153 | size
    Source: size_t size, pos, cur_pos, bytes_skipped;
    Source: if (!i_stream_get_buffer_space(stream, pos - cur_pos, &size))

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

i_stream_create_concat (238 to 282 istream-concat.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 261 | Pointer not checked for null before use : cstream | CERT EXP08-C,EXP34-C
| 260 |  |
    Source: cstream = i_new(struct concat_istream, 1);
    Source: cstream->input = i_new(struct istream *, count + 1);
M | 281 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return i_stream_create(&cstream->istream, NULL, -1);
M | 260 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: i_assert(count != 0);
    Source: cstream = i_new(struct concat_istream, 1);
M | 281 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: i_assert(count != 0);
    Source: return i_stream_create(&cstream->istream, NULL, -1);

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

i_stream_crlf_read_common (14 to 36 istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 33 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: if (!i_stream_get_buffer_space(stream, size, NULL))
M | 33 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: i_assert(size != 0);
    Source: if (!i_stream_get_buffer_space(stream, size, NULL))
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: ret = i_stream_read(stream->parent);
    Source: i_assert(size != 0);
M | 33 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: i_assert(size != 0);
    Source: if (!i_stream_get_buffer_space(stream, size, NULL))
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: ret = i_stream_read(stream->parent);
    Source: i_assert(size != 0);

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

i_stream_crlf_read_crlf (38 to 74 istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: ret = i_stream_crlf_read_common(cstream);
    Source: i_assert(ret > 0);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: ret = i_stream_crlf_read_common(cstream);
    Source: i_assert(ret > 0);

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

i_stream_crlf_read_lf (76 to 135 istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 132 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: ret = i_stream_crlf_read_common(cstream);
    Source: i_assert(ret > 0);
M | 132 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: ret = i_stream_crlf_read_common(cstream);
    Source: i_assert(ret > 0);
M | 130 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 129 |  |
    Source: i_assert(cstream->pending_cr && size == 1);
    Source: return i_stream_crlf_read_lf(stream);
M | 130 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 129 |  |
    Source: i_assert(cstream->pending_cr && size == 1);
    Source: return i_stream_crlf_read_lf(stream);

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

i_stream_create_crlf_full (143 to 160 istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 149 | Pointer not checked for null before use : cstream | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: cstream = i_new(struct crlf_istream, 1);
    Source: cstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
M | 148 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 670) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-CRLF_670.ref" looking for line -1105
    Source: cstream = i_new(struct crlf_istream, 1);

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

i_stream_create_from_data (19 to 36 istream-data.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 24 | Pointer not checked for null before use : stream | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: stream = i_new(struct istream_private, 1);
    Source: stream->buffer = data;
M | 33 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: (void)i_stream_create(stream, NULL, -1);
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 671) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-DATA_671.ref" looking for line -1105
    Source: stream = i_new(struct istream_private, 1);

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

i_stream_file_read (38 to 100 istream-file.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 83 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 82 |  |
    Source: i_assert(!fstream->file);
    Source: i_assert(stream->skip == stream->pos);
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: i_assert(ret != 0 || !fstream->file);
    Source: i_assert(ret != -1);
M | 82 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: i_assert(!stream->istream.blocking);
    Source: i_assert(!fstream->file);
M | 97 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 83 |  |
    Source: i_assert(stream->skip == stream->pos);
    Source: i_assert(ret != 0 || !fstream->file);
M | 83 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 82 |  |
    Source: i_assert(!fstream->file);
    Source: i_assert(stream->skip == stream->pos);
M | 98 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: i_assert(ret != 0 || !fstream->file);
    Source: i_assert(ret != -1);
M | 82 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: i_assert(!stream->istream.blocking);
    Source: i_assert(!fstream->file);
M | 97 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 83 |  |
    Source: i_assert(stream->skip == stream->pos);
    Source: i_assert(ret != 0 || !fstream->file);
M | 49 | User input not checked before use. : (stream)->w_buffer | CERT FIO30-C
| 57 |  |
    Source: ret = read(stream->fd, stream->w_buffer + stream->pos,
    Source: ret = pread(stream->fd, stream->w_buffer + stream->pos,
M | 41 | Procedure contains UR data flow anomalies. : size | CERT EXP33-C
| 44 |  |
    Source: if (!i_stream_get_buffer_space(stream, 1, &size))
    Source: size_t size;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream-file.c | 41 | istream-file.c | 44 | size
    Source: size_t size;
    Source: if (!i_stream_get_buffer_space(stream, 1, &size))

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

i_stream_create_fd (144 to 169 istream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 168 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return i_stream_create(&fstream->istream, NULL, fd);
M | 150 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 672) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-FILE_672.ref" looking for line -1105
    Source: fstream = i_new(struct file_istream, 1);

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

i_stream_create_limit (122 to 142 istream-limit.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 127 | Pointer not checked for null before use : lstream | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: lstream = i_new(struct limit_istream, 1);
    Source: lstream->v_size = v_size;
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 673) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-LIMIT_673.ref" looking for line -1105
    Source: lstream = i_new(struct limit_istream, 1);

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

i_stream_mmap_read (67 to 139 istream-mmap.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 121 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: i_assert(errno != 0);
    Source: i_error("mmap_istream.mmap(%s) failed: %m",
M | 137 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: i_error("mmap_istream.madvise(%s): %m",
    Source: i_assert(stream->pos - stream->skip > 0);
M | 103 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: i_error("mmap_istream.munmap(%s) failed: %m",
    Source: i_assert((uoff_t)mstream->mmap_offset + stream->buffer_size <=
M | 121 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: i_assert(errno != 0);
    Source: i_error("mmap_istream.mmap(%s) failed: %m",
M | 137 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: i_error("mmap_istream.madvise(%s): %m",
    Source: i_assert(stream->pos - stream->skip > 0);
M | 103 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: i_error("mmap_istream.munmap(%s) failed: %m",
    Source: i_assert((uoff_t)mstream->mmap_offset + stream->buffer_size <=

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

i_stream_create_mmap (197 to 239 istream-mmap.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 238 | Local structure returned in function result : istream |
    Source: return istream;
M | 220 | Pointer not checked for null before use : mstream | CERT EXP08-C,EXP34-C
| 219 |  |
    Source: mstream = i_new(struct mmap_istream, 1);
    Source: mstream->autoclose_fd = autoclose_fd;
M | 234 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: istream = i_stream_create(&mstream->istream, NULL, fd);
M | 212 | User input not checked before use. : st | CERT FIO30-C
| 209 |  |
    Source: if (fstat(fd, &st) < 0)
    Source: v_size = st.st_size;
M | 219 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 210 |  |
    Source: i_error("i_stream_create_mmap(): fstat() failed: %m");
    Source: mstream = i_new(struct mmap_istream, 1);
M | 234 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 210 |  |
    Source: i_error("i_stream_create_mmap(): fstat() failed: %m");
    Source: istream = i_stream_create(&mstream->istream, NULL, fd);

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

i_stream_seekable_destroy (44 to 57 istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 54 |  |
    Source: i_stream_unref(&sstream->input[i]);
    Source: i_free(sstream->temp_path);
M | 54 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: i_stream_unref(&sstream->fd_input);
    Source: i_stream_unref(&sstream->input[i]);

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

copy_to_temp_file (73 to 118 istream-seekable.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 110 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: i_error("istream-seekable: Couldn't read back "
    Source: i_stream_destroy(&sstream->fd_input);
M | 110 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: i_error("istream-seekable: Couldn't read back "
    Source: i_stream_destroy(&sstream->fd_input);
M | 114 | Pointer not checked for null before use : buffer | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: buffer = i_stream_get_data(sstream->fd_input, &size);
    Source: stream->buffer = buffer;
M | 107 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 106 |  |
    Source: if (i_stream_read(sstream->fd_input) <= 0) {
    Source: i_error("istream-seekable: Couldn't read back "
M | 106 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: sstream->fd_input =
    Source: if (i_stream_read(sstream->fd_input) <= 0) {
M | 107 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 106 |  |
    Source: if (i_stream_read(sstream->fd_input) <= 0) {
    Source: i_error("istream-seekable: Couldn't read back "
M | 106 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: sstream->fd_input =
    Source: if (i_stream_read(sstream->fd_input) <= 0) {
M | 76 | Procedure contains UR data flow anomalies. : path | CERT EXP33-C
| 81 |  |
    Source: fd = sstream->fd_callback(&path, sstream->context);
    Source: const char *path;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream-seekable.c | 76 | istream-seekable.c | 81 | path
    Source: const char *path;
    Source: fd = sstream->fd_callback(&path, sstream->context);

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

read_from_buffer (154 to 191 istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 179 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 178 |  |
    Source: data = i_stream_get_data(sstream->cur_input, &size);
    Source: buffer_append(sstream->buffer, data, size);
M | 179 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 172 |  |
    Source: *ret_r = read_more(sstream);
    Source: buffer_append(sstream->buffer, data, size);
M | 188 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 179 |  |
    Source: buffer_append(sstream->buffer, data, size);
    Source: i_assert(*ret_r > 0);
M | 179 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 172 |  |
    Source: *ret_r = read_more(sstream);
    Source: buffer_append(sstream->buffer, data, size);
M | 188 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 179 |  |
    Source: buffer_append(sstream->buffer, data, size);
    Source: i_assert(*ret_r > 0);

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

i_stream_seekable_write_failed (193 to 216 istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 202 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 200 |  |
    Source: sstream->buffer =
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
M | 204 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
    Source: if (pread_full(sstream->fd, data, sstream->write_peak, 0) < 0) {
M | 214 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 209 |  |
    Source: i_stream_destroy(&sstream->fd_input);
    Source: i_free_and_null(sstream->temp_path);
M | 200 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 198 |  |
    Source: i_assert(sstream->buffer == NULL);
    Source: sstream->buffer =
M | 205 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
    Source: i_error("read(%s) failed: %m", sstream->temp_path);
M | 209 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
    Source: i_stream_destroy(&sstream->fd_input);
M | 200 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 198 |  |
    Source: i_assert(sstream->buffer == NULL);
    Source: sstream->buffer =
M | 205 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
    Source: i_error("read(%s) failed: %m", sstream->temp_path);
M | 209 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 202 |  |
    Source: data = buffer_append_space_unsafe(sstream->buffer, sstream->write_peak);
    Source: i_stream_destroy(&sstream->fd_input);

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

i_stream_seekable_read (218 to 286 istream-seekable.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 252 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 251 |  |
    Source: data = i_stream_get_data(sstream->cur_input, &size);
    Source: ret = write(sstream->fd, data, size);
M | 234 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 230 |  |
    Source: if (read_from_buffer(sstream, &ret))
    Source: if (copy_to_temp_file(sstream) < 0) {
M | 236 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: if (!read_from_buffer(sstream, &ret))
M | 237 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 236 |  |
    Source: if (!read_from_buffer(sstream, &ret))
    Source: i_unreached();
M | 258 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 255 |  |
    Source: i_error("write_full(%s) failed: %m",
    Source: if (i_stream_seekable_write_failed(sstream) < 0)
M | 260 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: if (i_stream_seekable_write_failed(sstream) < 0)
    Source: if (!read_from_buffer(sstream, &ret))
M | 261 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 260 |  |
    Source: if (!read_from_buffer(sstream, &ret))
    Source: i_unreached();
M | 240 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: i_assert(sstream->buffer == NULL);
M | 270 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 243 |  |
    Source: i_assert(stream->istream.v_offset + stream->pos <= sstream->write_peak);
    Source: ret = i_stream_read(sstream->fd_input);
M | 243 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: i_assert(sstream->buffer == NULL);
    Source: i_assert(stream->istream.v_offset + stream->pos <= sstream->write_peak);
M | 234 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 230 |  |
    Source: if (read_from_buffer(sstream, &ret))
    Source: if (copy_to_temp_file(sstream) < 0) {
M | 236 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: if (!read_from_buffer(sstream, &ret))
M | 237 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 236 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: if (!read_from_buffer(sstream, &ret))
    Source: i_unreached();
M | 258 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 255 |  |
    Source: i_error("write_full(%s) failed: %m",
    Source: if (i_stream_seekable_write_failed(sstream) < 0)
M | 260 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: if (i_stream_seekable_write_failed(sstream) < 0)
    Source: if (!read_from_buffer(sstream, &ret))
M | 261 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 260 |  |
    Source: if (!read_from_buffer(sstream, &ret))
    Source: i_unreached();
M | 240 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: i_assert(sstream->buffer == NULL);
M | 270 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 243 |  |
    Source: i_assert(stream->istream.v_offset + stream->pos <= sstream->write_peak);
    Source: ret = i_stream_read(sstream->fd_input);
M | 243 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: i_assert(sstream->buffer == NULL);
    Source: i_assert(stream->istream.v_offset + stream->pos <= sstream->write_peak);
M | 236 | Pointer not checked for null before use : sstream.pos | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: if (!read_from_buffer(sstream, &ret))
M | 260 | Pointer not checked for null before use : sstream.pos | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: if (copy_to_temp_file(sstream) < 0) {
    Source: if (!read_from_buffer(sstream, &ret))
M | 223 | Procedure contains UR data flow anomalies. : ret | CERT EXP33-C
| 231 |  |
    Source: return ret;
    Source: ssize_t ret;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream-seekable.c | 223 | istream-seekable.c | 231 | ret
    Source: ssize_t ret;
    Source: return ret;

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

i_stream_seekable_stat (295 to 329 istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 312 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: } while ((ret = i_stream_seekable_read(stream)) > 0);
    Source: i_panic("i_stream_stat() used for non-blocking "
M | 324 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: i_panic("i_stream_stat() used for non-blocking "
    Source: i_assert(sstream->buffer != NULL);
M | 312 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: } while ((ret = i_stream_seekable_read(stream)) > 0);
    Source: i_panic("i_stream_stat() used for non-blocking "
M | 324 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: i_panic("i_stream_stat() used for non-blocking "
    Source: i_assert(sstream->buffer != NULL);
M | 316 | Pointer not checked for null before use : (stream)->istream.stream_errno | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: } while ((ret = i_stream_seekable_read(stream)) > 0);
    Source: i_stream_seek(&stream->istream, old_offset);

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

i_stream_create_seekable (331 to 388 istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 360 | Pointer not checked for null before use : sstream | CERT EXP08-C,EXP34-C
| 359 |  |
    Source: sstream = i_new(struct seekable_istream, 1);
    Source: sstream->fd_callback = fd_callback;
M | 372 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 362 |  |
    Source: sstream->buffer = buffer_create_dynamic(default_pool, BUF_INITIAL_SIZE);
    Source: buffer_append(sstream->buffer, data, size);
M | 372 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 371 |  |
    Source: data = i_stream_get_data(sstream->cur_input, &size);
    Source: buffer_append(sstream->buffer, data, size);
M | 387 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 372 |  |
    Source: buffer_append(sstream->buffer, data, size);
    Source: return i_stream_create(&sstream->istream, NULL, -1);
M | 387 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 372 |  |
    Source: buffer_append(sstream->buffer, data, size);
    Source: return i_stream_create(&sstream->istream, NULL, -1);
M | 387 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return i_stream_create(&sstream->istream, NULL, -1);
M | 359 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 357 |  |
    Source: i_assert(count != 0);
    Source: sstream = i_new(struct seekable_istream, 1);
M | 362 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 357 |  |
    Source: i_assert(count != 0);
    Source: sstream->buffer = buffer_create_dynamic(default_pool, BUF_INITIAL_SIZE);

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

tee_streams_update_buffer (23 to 48 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 37 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: data = i_stream_get_data(tee->input, &size);
    Source: tstream->istream.buffer = data;

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

i_stream_tee_destroy (75 to 102 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: i_stream_unref(&tee->input);
    Source: i_free(tee);
M | 91 | Pointer not checked for null before use : tee | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: *p = tstream->next;
    Source: if (tee->children == NULL) {
M | 102 | Memory not freed after last reference. : tee | CERT MEM00-C
    Source: }
M | 84 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: for (p = &tee->children; *p != NULL; p = &(*p)->next) {
    Source: for (p = &tee->children; *p != NULL; p = &(*p)->next) {
M | 97 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: i_assert(tee->input->v_offset <= tee->max_read_offset);
    Source: i_stream_unref(&tee->input);
M | 97 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: i_assert(tee->input->v_offset <= tee->max_read_offset);
    Source: i_stream_unref(&tee->input);

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

i_stream_tee_set_max_buffer_size (104 to 112 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 111 | Attempt to use already freed object. | CERT MEM31-C
    Source: i_stream_set_max_buffer_size(tstream->tee->input, max_size);

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

i_stream_tee_read (114 to 166 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 117 | Attempt to use already freed object. | CERT MEM31-C
    Source: struct istream *input = tstream->tee->input;
M | 139 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 138 |  |
    Source: tee_streams_skip(tstream->tee);
    Source: ret = i_stream_read(input);
M | 139 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 138 |  |
    Source: tee_streams_skip(tstream->tee);
    Source: ret = i_stream_read(input);
M | 158 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 128 |  |
    Source: data = i_stream_get_data(input, &size);
    Source: stream->buffer = data;
M | 138 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: i_assert(last_high_offset == input->v_offset + size);
    Source: tee_streams_skip(tstream->tee);
M | 152 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: ret = i_stream_read(input);
    Source: tee_streams_update_buffer(tstream->tee);
M | 157 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: i_assert(last_high_offset < input->v_offset + size);
    Source: i_assert(stream->pos < size);
M | 161 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 152 |  |
    Source: tee_streams_update_buffer(tstream->tee);
    Source: i_assert(stream->buffer == data);
M | 163 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: i_assert(stream->buffer == data);
    Source: i_assert(ret > 0);
M | 156 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: tee_streams_update_buffer(tstream->tee);
    Source: i_assert(last_high_offset < input->v_offset + size);
M | 138 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: i_assert(last_high_offset == input->v_offset + size);
    Source: tee_streams_skip(tstream->tee);
M | 152 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: ret = i_stream_read(input);
    Source: tee_streams_update_buffer(tstream->tee);
M | 157 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: i_assert(last_high_offset < input->v_offset + size);
    Source: i_assert(stream->pos < size);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 161 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 152 |  |
    Source: tee_streams_update_buffer(tstream->tee);
    Source: i_assert(stream->buffer == data);
M | 163 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: i_assert(stream->buffer == data);
    Source: i_assert(ret > 0);
M | 156 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: tee_streams_update_buffer(tstream->tee);
    Source: i_assert(last_high_offset < input->v_offset + size);

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

i_stream_tee_stat (168 to 174 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 173 | Attempt to use already freed object. | CERT MEM31-C
    Source: return i_stream_stat(tstream->tee->input, exact);

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

i_stream_tee_sync (176 to 188 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 182 | Attempt to use already freed object. | CERT MEM31-C
    Source: (void)i_stream_get_data(tstream->tee->input, &size);
M | 187 | Attempt to use already freed object. | CERT MEM31-C
    Source: i_stream_sync(tstream->tee->input);
M | 184 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 181 |  |
    Source: tee_streams_skip(tstream->tee);
    Source: i_panic("tee-istream: i_stream_sync() called "
M | 184 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 181 |  |
    Source: tee_streams_skip(tstream->tee);
    Source: i_panic("tee-istream: i_stream_sync() called "

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

tee_i_stream_create (190 to 199 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 198 | Local structure returned in function result : tee |
    Source: return tee;
M | 195 | Pointer not checked for null before use : tee | CERT EXP08-C,EXP34-C
| 194 |  |
    Source: tee = i_new(struct tee_istream, 1);
    Source: tee->input = input;
M | 194 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 676) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-TEE_676.ref" looking for line -1105
    Source: tee = i_new(struct tee_istream, 1);

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

tee_i_stream_create_child (201 to 226 istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 207 | Pointer not checked for null before use : tstream | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: tstream = i_new(struct tee_child_istream, 1);
    Source: tstream->tee = tee;
M | 224 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 222 |  |
    Source: ret = i_stream_create(&tstream->istream, input, i_stream_get_fd(input));
    Source: i_stream_unref(&input);
M | 224 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 222 |  |
    Source: ret = i_stream_create(&tstream->istream, input, i_stream_get_fd(input));
    Source: i_stream_unref(&input);
M | 206 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 676) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM-TEE_676.ref" looking for line -1105
    Source: tstream = i_new(struct tee_child_istream, 1);

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

i_stream_set_name (8 to 12 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 10 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(stream->real_stream->iostream.name);
M | 11 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 10 |  |
    Source: i_free(stream->real_stream->iostream.name);
    Source: stream->real_stream->iostream.name = i_strdup(name);
M | 11 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: stream->real_stream->iostream.name = i_strdup(name);
M | 10 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 677) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM_677.ref" looking for line -1105
    Source: i_free(stream->real_stream->iostream.name);

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

i_stream_read (99 to 140 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 134 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 133 |  |
    Source: i_assert(ret > 0);
    Source: i_assert((size_t)ret+old_size == _stream->pos - _stream->skip);
M | 134 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 133 |  |
    Source: i_assert(ret > 0);
    Source: i_assert((size_t)ret+old_size == _stream->pos - _stream->skip);

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

i_stream_next_line_finish (290 to 319 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 309 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 308 |  |
    Source: str_truncate(stream->line_str, 0);
    Source: str_append_n(stream->line_str, stream->buffer + stream->skip,
M | 309 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 308 |  |
    Source: str_truncate(stream->line_str, 0);
    Source: str_append_n(stream->line_str, stream->buffer + stream->skip,
M | 311 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: str_append_n(stream->line_str, stream->buffer + stream->skip,
    Source: ret = str_c_modifiable(stream->line_str);
M | 311 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: str_append_n(stream->line_str, stream->buffer + stream->skip,
    Source: ret = str_c_modifiable(stream->line_str);
M | 308 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: stream->line_str = str_new(default_pool, 256);
    Source: str_truncate(stream->line_str, 0);

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

i_stream_next_line (331 to 360 istream.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 358 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 353 |  |
    Source: ret_buf = i_stream_next_line_finish(_stream, i);
    Source: return i_stream_last_line(_stream);
M | 358 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 353 |  |
    Source: ret_buf = i_stream_next_line_finish(_stream, i);
    Source: return i_stream_last_line(_stream);
M | 349 | Procedure contains UR data flow anomalies. : ret_buf | CERT EXP33-C
| 334 |  |
    Source: char *ret_buf;
    Source: ret_buf = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream.c | 349 | istream.c | 357 | ret_buf
    Source: ret_buf = NULL;
    Source: if (ret_buf == NULL)

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

i_stream_read_next_line (362 to 375 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 371 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 367 |  |
    Source: line = i_stream_next_line(stream);
    Source: if (i_stream_read(stream) <= 0)
M | 372 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 371 |  |
    Source: if (i_stream_read(stream) <= 0)
    Source: return i_stream_last_line(stream->real_stream);
M | 367 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 371 |  |
    Source: if (i_stream_read(stream) <= 0)
    Source: line = i_stream_next_line(stream);
M | 371 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 367 |  |
    Source: line = i_stream_next_line(stream);
    Source: if (i_stream_read(stream) <= 0)
M | 372 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 371 |  |
    Source: if (i_stream_read(stream) <= 0)
    Source: return i_stream_last_line(stream->real_stream);
M | 367 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 371 |  |
    Source: if (i_stream_read(stream) <= 0)
    Source: line = i_stream_next_line(stream);

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

i_stream_grow_buffer (451 to 474 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 470 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 461 |  |
    Source: stream->buffer_size = nearest_power(stream->buffer_size);
    Source: stream->w_buffer = i_realloc(stream->w_buffer, old_size,

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

i_stream_get_buffer_space (476 to 495 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 488 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 479 |  |
    Source: i_assert(wanted_size > 0);
    Source: i_stream_grow_buffer(stream, I_STREAM_MIN_SIZE);
M | 488 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 479 |  |
    Source: i_assert(wanted_size > 0);
    Source: i_stream_grow_buffer(stream, I_STREAM_MIN_SIZE);

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

i_stream_add_data (497 to 510 istream.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 501 | Procedure contains UR data flow anomalies. : size2 | CERT EXP33-C
| 503 |  |
    Source: (void)i_stream_get_buffer_space(stream, size, &size2);
    Source: size_t size2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
istream.c | 501 | istream.c | 503 | size2
    Source: size_t size2;
    Source: (void)i_stream_get_buffer_space(stream, size, &size2);

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

i_stream_default_destroy (523 to 530 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 527 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 677) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\ISTREAM_677.ref" looking for line -1105
    Source: i_free(_stream->w_buffer);
M | 529 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 527 |  |
    Source: i_free(_stream->w_buffer);
    Source: i_stream_unref(&_stream->parent);
M | 529 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_stream_unref(&_stream->parent);

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

i_stream_default_seek (532 to 556 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 542 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 539 |  |
    Source: i_panic("stream doesn't support seeking backwards");
    Source: (void)i_stream_read(&stream->istream);
M | 542 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 539 |  |
    Source: i_panic("stream doesn't support seeking backwards");
    Source: (void)i_stream_read(&stream->istream);

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

i_stream_create (579 to 619 istream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 611 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memset(&_stream->statbuf, 0, sizeof(_stream->statbuf));

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

signal_read (146 to 189 lib-signals.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 164 | Insufficient space for operation. | CERT DCL33-C,FIO43-C
    Source: memcpy(signals, pending_signals, sizeof(signals));
M | 158 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: i_fatal("sigfillset() failed: %m");
    Source: i_fatal("sigprocmask() failed: %m");
M | 171 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 158 |  |
    Source: i_fatal("sigprocmask() failed: %m");
    Source: i_fatal("read(sigpipe) failed: EOF");
M | 174 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 171 |  |
    Source: i_fatal("read(sigpipe) failed: EOF");
    Source: i_fatal("sigprocmask() failed: %m");
M | 158 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: i_fatal("sigfillset() failed: %m");
    Source: i_fatal("sigprocmask() failed: %m");
M | 171 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 158 |  |
    Source: i_fatal("sigprocmask() failed: %m");
    Source: i_fatal("read(sigpipe) failed: EOF");
M | 174 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 171 |  |
    Source: i_fatal("read(sigpipe) failed: EOF");
    Source: i_fatal("sigprocmask() failed: %m");
M | 149 | Procedure contains UR data flow anomalies. : fullset | CERT EXP33-C
| 155 |  |
    Source: if (sigfillset(&fullset) < 0)
    Source: sigset_t fullset, oldset;
M | 149 | Procedure contains UR data flow anomalies. : oldset | CERT EXP33-C
| 157 |  |
    Source: if (sigprocmask(SIG_BLOCK, &fullset, &oldset) < 0)
    Source: sigset_t fullset, oldset;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
lib-signals.c | 149 | lib-signals.c | 155 | fullset
    Source: sigset_t fullset, oldset;
    Source: if (sigfillset(&fullset) < 0)
lib-signals.c | 149 | lib-signals.c | 157 | oldset
    Source: sigset_t fullset, oldset;
    Source: if (sigprocmask(SIG_BLOCK, &fullset, &oldset) < 0)

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

lib_signals_set (191 to 206 lib-signals.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 205 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: i_fatal("sigemptyset(): %m");
    Source: i_fatal("sigaction(%d): %m", signo);
M | 205 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: i_fatal("sigemptyset(): %m");
    Source: i_fatal("sigaction(%d): %m", signo);

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

lib_signals_set_handler (208 to 245 lib-signals.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 228 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 227 |  |
    Source: fd_set_nonblock(sig_pipe_fd[0], TRUE);
    Source: fd_set_nonblock(sig_pipe_fd[1], TRUE);
M | 228 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 227 |  |
    Source: fd_set_nonblock(sig_pipe_fd[0], TRUE);
    Source: fd_set_nonblock(sig_pipe_fd[1], TRUE);
M | 229 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 228 |  |
    Source: fd_set_nonblock(sig_pipe_fd[1], TRUE);
    Source: fd_close_on_exec(sig_pipe_fd[0], TRUE);
M | 229 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 228 |  |
    Source: fd_set_nonblock(sig_pipe_fd[1], TRUE);
    Source: fd_close_on_exec(sig_pipe_fd[0], TRUE);
M | 230 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: fd_close_on_exec(sig_pipe_fd[0], TRUE);
    Source: fd_close_on_exec(sig_pipe_fd[1], TRUE);
M | 230 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 229 |  |
    Source: fd_close_on_exec(sig_pipe_fd[0], TRUE);
    Source: fd_close_on_exec(sig_pipe_fd[1], TRUE);
M | 238 | Pointer not checked for null before use : h | CERT EXP08-C,EXP34-C
| 237 |  |
    Source: h = i_new(struct signal_handler, 1);
    Source: h->handler = handler;
M | 227 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 226 |  |
    Source: i_fatal("pipe() failed: %m");
    Source: fd_set_nonblock(sig_pipe_fd[0], TRUE);
M | 237 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 230 |  |
    Source: fd_close_on_exec(sig_pipe_fd[1], TRUE);
    Source: h = i_new(struct signal_handler, 1);
M | 216 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 213 |  |
    Source: i_assert(handler != NULL);
    Source: i_panic("Trying to set signal %d handler, but max is %d",
M | 221 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 216 |  |
    Source: i_panic("Trying to set signal %d handler, but max is %d",
    Source: lib_signals_set(signo, FALSE);
M | 227 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 226 |  |
    Source: i_fatal("pipe() failed: %m");
    Source: fd_set_nonblock(sig_pipe_fd[0], TRUE);
M | 216 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 213 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_assert(handler != NULL);
    Source: i_panic("Trying to set signal %d handler, but max is %d",
M | 221 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 216 |  |
    Source: i_panic("Trying to set signal %d handler, but max is %d",
    Source: lib_signals_set(signo, FALSE);

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

lib_signals_ignore (247 to 275 lib-signals.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 256 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_panic("Trying to ignore signal %d, but max is %d",
    Source: i_assert(signal_handlers[signo] == NULL);
M | 259 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 256 |  |
    Source: i_assert(signal_handlers[signo] == NULL);
    Source: i_fatal("sigemptyset(): %m");
M | 274 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 259 |  |
    Source: i_fatal("sigemptyset(): %m");
    Source: i_fatal("sigaction(%d): %m", signo);
M | 256 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_panic("Trying to ignore signal %d, but max is %d",
    Source: i_assert(signal_handlers[signo] == NULL);
M | 259 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 256 |  |
    Source: i_assert(signal_handlers[signo] == NULL);
    Source: i_fatal("sigemptyset(): %m");
M | 274 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 259 |  |
    Source: i_fatal("sigemptyset(): %m");
    Source: i_fatal("sigaction(%d): %m", signo);

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

lib_signals_unset_handler (277 to 293 lib-signals.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 285 | Pointer not checked for null before use : h | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: h = *p;
    Source: *p = h->next;
M | 282 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 282 |  |
    Source: for (p = &signal_handlers[signo]; *p != NULL; p = &(*p)->next) {
    Source: for (p = &signal_handlers[signo]; *p != NULL; p = &(*p)->next) {

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

lib_signals_deinit (319 to 346 lib-signals.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 332 | Pointer not checked for null before use : h | CERT EXP08-C,EXP34-C
| 331 |  |
    Source: h = handlers;
    Source: handlers = h->next;
M | 344 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 342 |  |
    Source: i_error("close(sigpipe) failed: %m");
    Source: i_error("close(sigpipe) failed: %m");
M | 342 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: io_remove(&io_sig);
    Source: i_error("close(sigpipe) failed: %m");
M | 339 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 333 |  |
    Source: i_free(h);
    Source: io_remove(&io_sig);
M | 333 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(h);
M | 339 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: io_remove(&io_sig);
M | 344 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 342 |  |
    Source: i_error("close(sigpipe) failed: %m");
    Source: i_error("close(sigpipe) failed: %m");
M | 342 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: io_remove(&io_sig);
    Source: i_error("close(sigpipe) failed: %m");

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

lib_init (21 to 28 lib.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: data_stack_init();
    Source: hostpid_init();
M | 27 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: data_stack_init();
    Source: hostpid_init();

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

lib_deinit (30 to 36 lib.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: data_stack_deinit();
    Source: failures_deinit();

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

body (65 to 159 md4.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 85 | Pointer not checked for null before use : ptr | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: ptr = data;
    Source: STEP(F, a, b, c, d, SET( 0),  3);

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

md4_update (172 to 205 md4.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 204 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 200 |  |
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
    Source: memcpy(ctx->buffer, data, size);
M | 200 | Pointer not checked for null before use : ctx.a | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 200 | Pointer not checked for null before use : ctx.b | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 200 | Pointer not checked for null before use : ctx.c | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 200 | Pointer not checked for null before use : ctx.d | CERT EXP08-C,EXP34-C
| 196 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);

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

md4_get_digest (259 to 267 md4.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 262 | Procedure contains UR data flow anomalies. : ctx.buffer | CERT EXP33-C
| 265 |  |
    Source: md4_update(&ctx, data, size);
    Source: struct md4_context ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
md4.c | 262 | md4.c | 265 | ctx.buffer
    Source: struct md4_context ctx;
    Source: md4_update(&ctx, data, size);

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

body (69 to 174 md5.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 89 | Pointer not checked for null before use : ptr | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: ptr = data;
    Source: STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)

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

md5_update (187 to 220 md5.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 219 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 215 |  |
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
    Source: memcpy(ctx->buffer, data, size);
M | 215 | Pointer not checked for null before use : ctx.a | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 215 | Pointer not checked for null before use : ctx.b | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 215 | Pointer not checked for null before use : ctx.c | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);
M | 215 | Pointer not checked for null before use : ctx.d | CERT EXP08-C,EXP34-C
| 211 |  |
    Source: body(ctx, ctx->buffer, 64);
    Source: data = body(ctx, data, size & ~(unsigned long)0x3f);

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

md5_get_digest (274 to 282 md5.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 277 | Procedure contains UR data flow anomalies. : ctx.buffer | CERT EXP33-C
| 280 |  |
    Source: md5_update(&ctx, data, size);
    Source: struct md5_context ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
md5.c | 277 | md5.c | 280 | ctx.buffer
    Source: struct md5_context ctx;
    Source: md5_update(&ctx, data, size);

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

pool_alloconly_create (123 to 161 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 145 | Pointer not checked for null before use : new_apool | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: new_apool = p_new(&apool.pool, struct alloconly_pool, 1);
    Source: *new_apool = apool;
M | 145 | Pointer not checked for null before use : apool.block | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: block_alloc(&apool, size);
    Source: *new_apool = apool;
M | 136 | Pointer not checked for null before use : static_alloconly_pool.v | CERT EXP08-C,EXP34-C
| 82 |  |
    Source: static const struct pool static_alloconly_pool = {
    Source: apool.pool = static_alloconly_pool;
M | 141 | Pointer not checked for null before use : apool.block | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: memset(&apool, 0, sizeof(apool));
    Source: block_alloc(&apool, size);
M | 145 | Pointer not checked for null before use : apool.pool.v | CERT EXP08-C,EXP34-C
| 136 |  |
    Source: apool.pool = static_alloconly_pool;
    Source: *new_apool = apool;
M | 141 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: size = nearest_power(size + min_alloc);
    Source: block_alloc(&apool, size);
M | 158 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: block_alloc(&apool, size);
    Source: i_assert(new_apool->block->prev == NULL);
M | 141 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: size = nearest_power(size + min_alloc);
    Source: block_alloc(&apool, size);
M | 158 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: block_alloc(&apool, size);
    Source: i_assert(new_apool->block->prev == NULL);

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

pool_alloconly_create_clean (163 to 172 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 169 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: pool = pool_alloconly_create(name, size);
    Source: apool = (struct alloconly_pool *)pool;
M | 170 | Pointer not checked for null before use : apool | CERT EXP08-C,EXP34-C
| 169 |  |
    Source: apool = (struct alloconly_pool *)pool;
    Source: apool->clean_frees = TRUE;

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

pool_alloconly_destroy (174 to 195 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 193 | free parameter is not heap item. | CERT MEM34-C
    Source: free(block);
M | 187 | Pointer not checked for null before use : block | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: block = apool->block;
    Source: safe_memset(block, CLEAR_CHR,

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

block_alloc (229 to 267 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 259 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: size = nearest_power(size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%"PRIuSIZE_T
M | 259 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 240 |  |
    Source: size = nearest_power(size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%"PRIuSIZE_T
M | 267 | Memory not freed after last reference. : block | CERT MEM00-C
    Source: }

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

pool_alloconly_malloc (269 to 302 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 286 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 276 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: block_alloc(apool, alloc_size + SIZEOF_POOLBLOCK);
M | 286 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 276 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: block_alloc(apool, alloc_size + SIZEOF_POOLBLOCK);

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

pool_alloconly_realloc (337 to 363 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 359 | Pointer not checked for null before use : new_mem | CERT EXP08-C,EXP34-C
| 358 |  |
    Source: memcpy(new_mem, mem, old_size);
    Source: mem = new_mem;
M | 347 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 344 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: return pool_alloconly_malloc(pool, new_size);
M | 347 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 344 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: return pool_alloconly_malloc(pool, new_size);

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

pool_alloconly_clear (365 to 405 mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 401 | Attempt to use already freed object. | CERT MEM31-C
    Source: safe_memset(PTR_OFFSET(POOL_BLOCK_DATA(apool->block), base_size), 0,
M | 379 | Pointer not checked for null before use : block | CERT EXP08-C,EXP34-C
| 378 |  |
    Source: block = apool->block;
    Source: apool->block = block->prev;
M | 386 | Pointer not checked for null before use : block | CERT EXP08-C,EXP34-C
| 385 |  |
    Source: safe_memset(block, CLEAR_CHR,
    Source: SIZEOF_POOLBLOCK + block->size);

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

pool_datastack_create (47 to 56 mempool-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 52 | Pointer not checked for null before use : dpool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: dpool = t_new(struct datastack_pool, 1);
    Source: dpool->pool = static_data_stack_pool;
M | 52 | Pointer not checked for null before use : static_data_stack_pool.v | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: static const struct pool static_data_stack_pool = {
    Source: dpool->pool = static_data_stack_pool;

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

pool_data_stack_unref (73 to 84 mempool-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_panic("pool_data_stack_unref(): stack frame changed");
    Source: i_assert(dpool->refcount >= 0);
M | 81 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_panic("pool_data_stack_unref(): stack frame changed");
    Source: i_assert(dpool->refcount >= 0);

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

pool_data_stack_malloc (86 to 97 mempool-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 96 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: i_panic("pool_data_stack_malloc(): stack frame changed");
    Source: return t_malloc0(size);
M | 96 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: i_panic("pool_data_stack_malloc(): stack frame changed");
    Source: return t_malloc0(size);

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

pool_data_stack_realloc (107 to 134 mempool-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 129 | Pointer not checked for null before use : new_mem | CERT EXP08-C,EXP34-C
| 128 |  |
    Source: memcpy(new_mem, mem, old_size);
    Source: mem = new_mem;
M | 127 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: if (!t_try_realloc(mem, new_size)) {
    Source: new_mem = t_malloc(new_size);
M | 118 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
M | 121 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
    Source: return pool_data_stack_malloc(pool, new_size);
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
    Source: if (!t_try_realloc(mem, new_size)) {
M | 127 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: if (!t_try_realloc(mem, new_size)) {
    Source: new_mem = t_malloc(new_size);
M | 118 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
M | 121 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
    Source: return pool_data_stack_malloc(pool, new_size);
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: i_panic("pool_data_stack_realloc(): stack frame changed");
    Source: if (!t_try_realloc(mem, new_size)) {

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

pool_system_clean_malloc (93 to 121 mempool-system-clean.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 120 | Local structure returned in function result : mem |
    Source: return mem;
M | 117 | Pointer not checked for null before use : mem | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: *saved_size = size - EXTRA_SIZE_SPACE;
    Source: mem = PTR_OFFSET(mem, EXTRA_SIZE_SPACE);
M | 109 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 98 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%"PRIuSIZE_T
M | 109 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 98 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%"PRIuSIZE_T

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

pool_system_clean_free (123 to 134 mempool-system-clean.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 131 | free parameter is not heap item. | CERT MEM34-C
    Source: free(mem);
M | 126 | Pointer not checked for null before use : mem | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: safe_memset(mem, 0, mem_get_size(mem));
    Source: safe_memset(mem, 0, mem_get_size(mem));

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

pool_system_clean_realloc (136 to 163 mempool-system-clean.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 145 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: new_mem = pool_system_clean_malloc(pool, new_size);
M | 145 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: new_mem = pool_system_clean_malloc(pool, new_size);

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

pool_system_malloc (73 to 90 mempool-system.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 89 | Local structure returned in function result : mem |
    Source: return mem;
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%"PRIuSIZE_T
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%"PRIuSIZE_T

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

pool_system_free (92 to 101 mempool-system.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 99 | free parameter is not heap item. | CERT MEM34-C
    Source: free(mem);

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

pool_system_realloc (103 to 130 mempool-system.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 120 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 110 |  |
    Source: i_assert(old_size == (size_t)-1 || mem == NULL ||
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_realloc(%"PRIuSIZE_T
M | 110 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: i_assert(old_size == (size_t)-1 || mem == NULL ||
M | 120 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 110 |  |
    Source: i_assert(old_size == (size_t)-1 || mem == NULL ||
    Source: i_fatal_status(FATAL_OUTOFMEM, "pool_system_realloc(%"PRIuSIZE_T
M | 110 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: i_assert(old_size == (size_t)-1 || mem == NULL ||

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

pool_unsafe_data_stack_malloc (55 to 62 mempool-unsafe-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 61 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: return t_malloc0(size);
M | 61 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size);
    Source: return t_malloc0(size);

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

pool_unsafe_data_stack_realloc (69 to 93 mempool-unsafe-datastack.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 88 | Pointer not checked for null before use : new_mem | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: memcpy(new_mem, mem, old_size);
    Source: mem = new_mem;
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: if (!t_try_realloc(mem, new_size)) {
    Source: new_mem = t_malloc(new_size);
M | 80 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: return pool_unsafe_data_stack_malloc(pool, new_size);
M | 85 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: if (!t_try_realloc(mem, new_size)) {
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: if (!t_try_realloc(mem, new_size)) {
    Source: new_mem = t_malloc(new_size);
M | 80 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: return pool_unsafe_data_stack_malloc(pool, new_size);
M | 85 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_panic("Trying to allocate %"PRIuSIZE_T" bytes", new_size);
    Source: if (!t_try_realloc(mem, new_size)) {

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

pool_get_exp_grown_size (5 to 18 mempool.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 11 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 9 |  |
    Source: i_assert(old_size < min_size);
    Source: exp_size = nearest_power(min_size);
M | 16 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 11 |  |
    Source: exp_size = nearest_power(min_size);
    Source: i_assert(exp_size >= min_size);
M | 11 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 9 |  |
    Source: i_assert(old_size < min_size);
    Source: exp_size = nearest_power(min_size);
M | 16 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 11 |  |
    Source: exp_size = nearest_power(min_size);
    Source: i_assert(exp_size >= min_size);

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

mkdir_chown_full (13 to 66 mkdir-parents.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 44 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: str = t_str_new(256);
    Source: str_printfa(str, "chown(%s, %ld", path,
M | 44 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: str = t_str_new(256);
    Source: str_printfa(str, "chown(%s, %ld", path,
M | 44 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: str = t_str_new(256);
    Source: str_printfa(str, "chown(%s, %ld", path,
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 50 |  |
    Source: str_printfa(str, "(%s)", pw->pw_name);
    Source: str_printfa(str, ", %ld",
M | 62 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: str_printfa(str, "(%s)", gr->gr_name);
    Source: i_error("%s) failed: %m", str_c(str));
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 50 |  |
    Source: str_printfa(str, "(%s)", pw->pw_name);
    Source: str_printfa(str, ", %ld",
M | 62 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: str_printfa(str, "(%s)", gr->gr_name);
    Source: i_error("%s) failed: %m", str_c(str));

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

mkdir_chown (68 to 71 mkdir-parents.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 70 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return mkdir_chown_full(path, mode, uid, gid, NULL);

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

mkdir_parents_chown_full (79 to 108 mkdir-parents.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 104 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 99 |  |
    Source: } T_END;
    Source: if (mkdir_chown_full(path, mode, uid, gid, gid_origin) < 0)
M | 95 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: if (mkdir_chown_full(path, mode, uid, gid, gid_origin) < 0) {
    Source: T_BEGIN {
M | 104 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 99 |  |
    Source: } T_END;
    Source: if (mkdir_chown_full(path, mode, uid, gid, gid_origin) < 0)
M | 95 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: if (mkdir_chown_full(path, mode, uid, gid, gid_origin) < 0) {
    Source: T_BEGIN {
M | 96 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: T_BEGIN {
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
M | 96 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: T_BEGIN {
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
M | 96 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
M | 96 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
M | 99 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
    Source: } T_END;
M | 99 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: ret = mkdir_parents_chown_full(t_strdup_until(path, p),
    Source: } T_END;

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

mkdir_parents_chown (110 to 113 mkdir-parents.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 112 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return mkdir_parents_chown_full(path, mode, uid, gid, NULL);

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

mmap_file (8 to 28 mmap-util.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | User input not checked before use. : st | CERT FIO30-C
| 12 |  |
    Source: if (fstat(fd, &st) < 0)
    Source: *length = (size_t)st.st_size;

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

module_get_symbol (32 to 47 module-dir.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 43 | Procedure contains UR data flow anomalies. : ret | CERT EXP33-C
| 35 |  |
    Source: void *ret;
    Source: ret = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
module-dir.c | 43 | module-dir.c | 46 | ret
    Source: ret = NULL;
    Source: return ret;

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

module_free (57 to 66 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 64 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_free(module->path);
    Source: i_free(module->name);
M | 64 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(module->name);
M | 65 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: i_free(module->name);
    Source: i_free(module);
M | 65 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: i_free(module);
M | 65 | Pointer not checked for null before use : (module)->path | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_free(module->path);
    Source: i_free(module);
M | 65 | Pointer not checked for null before use : (module)->name | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: i_free(module->name);
    Source: i_free(module);
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: i_error("dlclose(%s) failed: %m", module->path);
    Source: i_free(module->path);

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

module_check_missing_dependencies (68 to 97 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 81 | Pointer not checked for null before use : deps | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: for (; *deps != NULL; deps++) {
    Source: for (; *deps != NULL; deps++) {
M | 90 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: deps = dlsym(module->handle,
    Source: i_error("Can't load plugin %s: "
M | 90 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: deps = dlsym(module->handle,
    Source: i_error("Can't load plugin %s: "

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

module_load (99 to 156 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 155 | Local structure returned in function result : module |
    Source: return module;
M | 116 | Pointer not checked for null before use : module | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: module = i_new(struct module, 1);
    Source: module->path = i_strdup(path);
M | 121 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
M | 121 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: i_error("Module is for different version %s: %s",
    Source: module_free(module);
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: i_error("Module is for different version %s: %s",
    Source: module_free(module);
M | 132 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 132 |  |
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
M | 132 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 132 |  |
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
M | 135 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 132 |  |
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
M | 135 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 132 |  |
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
M | 135 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
M | 135 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
M | 149 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: if (!module_check_missing_dependencies(module, all_modules)) {
    Source: module_free(module);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_error("Module doesn't have %s function: %s",
    Source: module_free(module);
M | 154 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: if (!module_check_missing_dependencies(module, all_modules)) {
    Source: i_debug("Module loaded: %s", path);
M | 132 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
M | 147 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
    Source: if (!module_check_missing_dependencies(module, all_modules)) {
M | 149 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: if (!module_check_missing_dependencies(module, all_modules)) {
    Source: module_free(module);
M | 143 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_error("Module doesn't have %s function: %s",
    Source: module_free(module);
M | 154 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: if (!module_check_missing_dependencies(module, all_modules)) {
    Source: i_debug("Module loaded: %s", path);
M | 132 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: get_symbol(module, t_strconcat(name, "_version", NULL), TRUE);
    Source: get_symbol(module, t_strconcat(name, "_init", NULL),
M | 147 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: get_symbol(module, t_strconcat(name, "_deinit", NULL),
    Source: if (!module_check_missing_dependencies(module, all_modules)) {

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

module_name_cmp (158 to 168 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 167 | Pointer not checked for null before use : s1 | CERT EXP08-C,EXP34-C
| 163 |  |
    Source: s1 += 3;
    Source: return strcmp(s1, s2);
M | 167 | Pointer not checked for null before use : s2 | CERT EXP08-C,EXP34-C
| 165 |  |
    Source: s2 += 3;
    Source: return strcmp(s1, s2);

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

check_duplicates (184 to 199 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 195 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 193 |  |
    Source: tmp = module_file_get_name(names_p[i]);
    Source: if (strcmp(tmp, base_name) == 0)
M | 193 | Pointer not checked for null before use : names_p | CERT EXP08-C,EXP34-C
| 191 |  |
    Source: names_p = array_get(names, &count);
    Source: tmp = module_file_get_name(names_p[i]);
M | 195 | Pointer not checked for null before use : base_name | CERT EXP08-C,EXP34-C
| 190 |  |
    Source: base_name = module_file_get_name(name);
    Source: if (strcmp(tmp, base_name) == 0)
M | 196 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 193 |  |
    Source: tmp = module_file_get_name(names_p[i]);
    Source: i_fatal("Multiple files for module %s: %s/%s, %s/%s",
M | 193 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 190 |  |
    Source: base_name = module_file_get_name(name);
    Source: tmp = module_file_get_name(names_p[i]);
M | 196 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 193 |  |
    Source: tmp = module_file_get_name(names_p[i]);
    Source: i_fatal("Multiple files for module %s: %s/%s, %s/%s",
M | 193 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 190 |  |
    Source: base_name = module_file_get_name(name);
    Source: tmp = module_file_get_name(names_p[i]);

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

module_dir_load_real (238 to 335 module-dir.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 272 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 271 |  |
    Source: pool = pool_alloconly_create("module loader", 4096);
    Source: p_array_init(&names, pool, 32);
M | 272 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 271 |  |
    Source: pool = pool_alloconly_create("module loader", 4096);
    Source: p_array_init(&names, pool, 32);
M | 272 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 271 |  |
    Source: pool = pool_alloconly_create("module loader", 4096);
    Source: p_array_init(&names, pool, 32);
M | 286 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 285 |  |
    Source: T_BEGIN {
    Source: check_duplicates(&names, name, dir);
M | 286 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 285 |  |
    Source: T_BEGIN {
    Source: check_duplicates(&names, name, dir);
M | 287 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 286 |  |
    Source: check_duplicates(&names, name, dir);
    Source: } T_END;
M | 287 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 286 |  |
    Source: check_duplicates(&names, name, dir);
    Source: } T_END;
M | 290 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 287 |  |
    Source: } T_END;
    Source: array_append(&names, &name, 1);
M | 290 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 287 |  |
    Source: } T_END;
    Source: array_append(&names, &name, 1);
M | 290 | Pointer not checked for null before use : name | CERT EXP08-C,EXP34-C
| 289 |  |
    Source: name = p_strdup(pool, d->d_name);
    Source: array_append(&names, &name, 1);
M | 299 | Pointer not checked for null before use : modules | CERT EXP08-C,EXP34-C
| 298 |  |
    Source: modules = old_modules;
    Source: module_pos = &modules;
M | 306 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 302 |  |
    Source: for (i = 0; i < count; i++) T_BEGIN {
    Source: stripped_name = module_file_get_name(name);
M | 306 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 302 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: for (i = 0; i < count; i++) T_BEGIN {
    Source: stripped_name = module_file_get_name(name);
M | 306 | Pointer not checked for null before use : name | CERT EXP08-C,EXP34-C
| 305 |  |
    Source: name = names_p[i];
    Source: stripped_name = module_file_get_name(name);
M | 307 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: stripped_name = module_file_get_name(name);
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
M | 307 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: stripped_name = module_file_get_name(name);
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
M | 307 | Pointer not checked for null before use : stripped_name | CERT EXP08-C,EXP34-C
| 306 |  |
    Source: stripped_name = module_file_get_name(name);
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
M | 308 | Pointer not checked for null before use : suffixless_name | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
    Source: if (!module_want_load(module_names, suffixless_name) ||
M | 313 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: path = t_strconcat(dir, "/", name, NULL);
    Source: module = module_load(path, stripped_name, set, modules);
M | 313 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: path = t_strconcat(dir, "/", name, NULL);
    Source: module = module_load(path, stripped_name, set, modules);
M | 313 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: path = t_strconcat(dir, "/", name, NULL);
    Source: module = module_load(path, stripped_name, set, modules);
M | 300 | Pointer not checked for null before use : module_pos | CERT EXP08-C,EXP34-C
| 301 |  |
    Source: module_pos = &(*module_pos)->next;
    Source: while (*module_pos != NULL)
M | 319 | Pointer not checked for null before use : module_pos | CERT EXP08-C,EXP34-C
| 320 |  |
    Source: module_pos = &module->next;
    Source: *module_pos = module;
M | 271 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 257 |  |
    Source: i_debug("Loading modules from directory: %s", dir);
    Source: pool = pool_alloconly_create("module loader", 4096);
M | 267 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 264 |  |
    Source: i_fatal("opendir(%s) failed: %m", dir);
    Source: i_error("opendir(%s) failed: %m", dir);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 302 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 322 |  |
    Source: } T_END;
    Source: for (i = 0; i < count; i++) T_BEGIN {
M | 312 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
    Source: path = t_strconcat(dir, "/", name, NULL);
M | 315 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 313 |  |
    Source: module = module_load(path, stripped_name, set, modules);
    Source: i_fatal("Couldn't load required plugins");
M | 293 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 272 |  |
    Source: p_array_init(&names, pool, 32);
    Source: i_error("closedir(%s) failed: %m", dir);
M | 322 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 315 |  |
    Source: i_fatal("Couldn't load required plugins");
    Source: } T_END;
M | 328 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 322 |  |
    Source: } T_END;
    Source: i_fatal("Plugin %s not found from directory %s",
M | 271 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 257 |  |
    Source: i_debug("Loading modules from directory: %s", dir);
    Source: pool = pool_alloconly_create("module loader", 4096);
M | 267 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 264 |  |
    Source: i_fatal("opendir(%s) failed: %m", dir);
    Source: i_error("opendir(%s) failed: %m", dir);
M | 302 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 322 |  |
    Source: } T_END;
    Source: for (i = 0; i < count; i++) T_BEGIN {
M | 312 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
    Source: path = t_strconcat(dir, "/", name, NULL);
M | 315 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 313 |  |
    Source: module = module_load(path, stripped_name, set, modules);
    Source: i_fatal("Couldn't load required plugins");
M | 293 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 272 |  |
    Source: p_array_init(&names, pool, 32);
    Source: i_error("closedir(%s) failed: %m", dir);
M | 322 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 315 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_fatal("Couldn't load required plugins");
    Source: } T_END;
M | 328 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 322 |  |
    Source: } T_END;
    Source: i_fatal("Plugin %s not found from directory %s",
M | 290 | Pointer not checked for null before use : (arr)->buffer | CERT EXP08-C,EXP34-C
| 272 |  |
    Source: p_array_init(&names, pool, 32);
    Source: array_append(&names, &name, 1);
M | 290 | Pointer not checked for null before use : (arr)->element_size | CERT EXP08-C,EXP34-C
| 272 |  |
    Source: p_array_init(&names, pool, 32);
    Source: array_append(&names, &name, 1);
M | 309 | Pointer not checked for null before use : suffixless_name | CERT EXP08-C,EXP34-C
| 307 |  |
    Source: suffixless_name = module_name_drop_suffix(stripped_name);
    Source: module_is_loaded(old_modules, suffixless_name))
M | 248 | Procedure contains UR data flow anomalies. : names.arr.buffer | CERT EXP33-C
| 286 |  |
    Source: check_duplicates(&names, name, dir);
    Source: ARRAY_TYPE(const_string) names;
M | 248 | Procedure contains UR data flow anomalies. : names.arr.element_size | CERT EXP33-C
| 286 |  |
    Source: check_duplicates(&names, name, dir);
    Source: ARRAY_TYPE(const_string) names;
M | 249 | Procedure contains UR data flow anomalies. : pool | CERT EXP33-C
| 20 (test-mempool-alloconly.c) |  |
    Source: pool_t pool;
    Source: pool_t pool;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
module-dir.c | 248 | module-dir.c | 286 | names.arr.buffer
    Source: ARRAY_TYPE(const_string) names;
    Source: check_duplicates(&names, name, dir);
module-dir.c | 248 | module-dir.c | 286 | names.arr.element_size
    Source: ARRAY_TYPE(const_string) names;
    Source: check_duplicates(&names, name, dir);
module-dir.c | 249 | module-dir.c | 257 | pool
    Source: pool_t pool;
    Source: i_debug("Loading modules from directory: %s", dir);
module-dir.c | 249 | module-dir.c | 267 | pool
    Source: pool_t pool;
    Source: i_error("opendir(%s) failed: %m", dir);

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

module_dir_load_missing (337 to 355 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 349 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: arr = t_strsplit_spaces(module_names, ", ");
    Source: module_names_fix(arr);
M | 349 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: arr = t_strsplit_spaces(module_names, ", ");
    Source: module_names_fix(arr);
M | 353 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: modules = module_dir_load_real(old_modules, dir, arr, set);
    Source: } T_END;
M | 353 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: modules = module_dir_load_real(old_modules, dir, arr, set);
    Source: } T_END;
M | 352 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 349 |  |
    Source: module_names_fix(arr);
    Source: modules = module_dir_load_real(old_modules, dir, arr, set);
M | 348 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 344 |  |
    Source: T_BEGIN {
    Source: arr = t_strsplit_spaces(module_names, ", ");
M | 352 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 349 |  |
    Source: module_names_fix(arr);
    Source: modules = module_dir_load_real(old_modules, dir, arr, set);
M | 348 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 344 |  |
    Source: T_BEGIN {
    Source: arr = t_strsplit_spaces(module_names, ", ");
M | 345 | Declaration types do not match across a system. : arr | CERT ARR31-C
    Source: const char **arr = NULL;

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

module_dir_init (357 to 367 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 365 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 362 |  |
    Source: if (module->init != NULL && !module->initialized) T_BEGIN {
    Source: } T_END;
M | 365 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 362 |  |
    Source: if (module->init != NULL && !module->initialized) T_BEGIN {
    Source: } T_END;
M | 362 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: } T_END;
    Source: if (module->init != NULL && !module->initialized) T_BEGIN {
M | 362 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: } T_END;
    Source: if (module->init != NULL && !module->initialized) T_BEGIN {

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

module_dir_deinit (369 to 397 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 382 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 381 |  |
    Source: T_BEGIN {
    Source: rev = t_new(struct module *, count);
M | 382 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 381 |  |
    Source: T_BEGIN {
    Source: rev = t_new(struct module *, count);
M | 389 | Pointer not checked for null before use : rev | CERT EXP08-C,EXP34-C
| 382 |  |
    Source: rev = t_new(struct module *, count);
    Source: module = rev[i];
M | 384 | Pointer not checked for null before use : module | CERT EXP08-C,EXP34-C
| 383 |  |
    Source: for (i = 0, module = modules; i < count; i++) {
    Source: rev[count-i-1] = module;
M | 396 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 382 |  |
    Source: rev = t_new(struct module *, count);
    Source: } T_END;
M | 396 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 382 |  |
    Source: rev = t_new(struct module *, count);
    Source: } T_END;

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

module_dir_unload (399 to 413 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 407 | Pointer not checked for null before use : next | CERT EXP08-C,EXP34-C
| 408 |  |
    Source: next = module->next;
    Source: for (module = *modules; module != NULL; module = next) {
M | 409 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 405 |  |
    Source: module_dir_deinit(*modules);
    Source: module_free(module);
M | 409 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 405 |  |
    Source: module_dir_deinit(*modules);
    Source: module_free(module);
M | 408 | Pointer not checked for null before use : (module)->deinit | CERT EXP08-C,EXP34-C
| 409 |  |
    Source: module_free(module);
    Source: next = module->next;
M | 408 | Pointer not checked for null before use : (module)->initialized | CERT EXP08-C,EXP34-C
| 409 |  |
    Source: module_free(module);
    Source: next = module->next;
M | 408 | Pointer not checked for null before use : (module)->handle | CERT EXP08-C,EXP34-C
| 409 |  |
    Source: module_free(module);
    Source: next = module->next;
M | 408 | Attempt to read from freed memory. : module | CERT MEM30-C
    Source: next = module->next;

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

module_dir_load (459 to 463 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 462 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return module_dir_load_missing(NULL, dir, module_names, set);

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

module_file_get_name (465 to 485 module-dir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 473 | Pointer not checked for null before use : fname | CERT EXP08-C,EXP34-C
| 471 |  |
    Source: fname += 3;
    Source: for (p = fname; *p != '\0'; p++) {
M | 480 | Pointer not checked for null before use : fname | CERT EXP08-C,EXP34-C
| 478 |  |
    Source: fname = p + 1;
    Source: p = strstr(fname, MODULE_SUFFIX);

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

mountpoint_get (51 to 215 mountpoint.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 209 | Pointer not checked for null before use : point_r | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: memset(point_r, 0, sizeof(*point_r));
    Source: point_r->device_path = p_strdup(pool, device_path);
M | 103 | User input not checked before use. : st | CERT FIO30-C
| 96 |  |
    Source: if (stat(path, &st) < 0) {
    Source: block_size = st.st_blksize;

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

net_ip_cmp (36 to 47 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 43 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: return memcmp(&ip1->u.ip6, &ip2->u.ip6, sizeof(ip1->u.ip6));
M | 46 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: return memcmp(&ip1->u.ip4, &ip2->u.ip4, sizeof(ip1->u.ip4));

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

net_ip_hash (49 to 73 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 57 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: len = sizeof(ip->u.ip6);
M | 65 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: for (; len > 0; len--, p++) {
    Source: h = (h << 4) + *p;

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

sin_set_ip (76 to 97 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 93 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memcpy(&so->sin6.sin6_addr, &ip->u.ip6, sizeof(ip->u.ip6));
M | 96 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memcpy(&so->sin.sin_addr, &ip->u.ip4, sizeof(ip->u.ip4));

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

sin_get_ip (99 to 113 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 106 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memcpy(&ip->u.ip6, &so->sin6.sin6_addr, sizeof(ip->u.ip6));
M | 110 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memcpy(&ip->u.ip4, &so->sin.sin_addr, sizeof(ip->u.ip4));
M | 112 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: memset(&ip->u, 0, sizeof(ip->u));

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

net_connect_ip (166 to 218 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 190 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 173 |  |
    Source: i_warning("net_connect_ip(): ip->family != my_ip->family");
    Source: net_set_nonblock(fd, TRUE);
M | 196 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 190 |  |
    Source: net_set_nonblock(fd, TRUE);
    Source: i_error("bind(%s) failed: %m", net_ip2addr(my_ip));
M | 190 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 173 |  |
    Source: i_warning("net_connect_ip(): ip->family != my_ip->family");
    Source: net_set_nonblock(fd, TRUE);
M | 196 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 190 |  |
    Source: net_set_nonblock(fd, TRUE);
    Source: i_error("bind(%s) failed: %m", net_ip2addr(my_ip));

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

net_connect_unix_with_retries (278 to 297 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 287 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: i_panic("gettimeofday() failed: %m");
    Source: fd = net_connect_unix(path);
M | 294 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 287 |  |
    Source: fd = net_connect_unix(path);
    Source: i_panic("gettimeofday() failed: %m");
M | 287 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: i_panic("gettimeofday() failed: %m");
    Source: fd = net_connect_unix(path);
M | 294 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 287 |  |
    Source: fd = net_connect_unix(path);
    Source: i_panic("gettimeofday() failed: %m");
M | 280 | Procedure contains UR data flow anomalies. : now | CERT EXP33-C
| 293 |  |
    Source: if (gettimeofday(&now, NULL) < 0)
    Source: struct timeval start, now;
M | 280 | Procedure contains UR data flow anomalies. : start | CERT EXP33-C
| 283 |  |
    Source: if (gettimeofday(&start, NULL) < 0)
    Source: struct timeval start, now;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 280 | network.c | 293 | now
    Source: struct timeval start, now;
    Source: if (gettimeofday(&now, NULL) < 0)
network.c | 280 | network.c | 283 | start
    Source: struct timeval start, now;
    Source: if (gettimeofday(&start, NULL) < 0)

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

net_set_nonblock (307 to 311 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 310 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: if (fd_set_nonblock(fd, nonblock) < 0)
    Source: i_fatal("fd_set_nonblock(%d) failed: %m", fd);
M | 310 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 309 |  |
    Source: if (fd_set_nonblock(fd, nonblock) < 0)
    Source: i_fatal("fd_set_nonblock(%d) failed: %m", fd);

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

net_listen_unix_unlink_stale (447 to 472 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 457 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 452 |  |
    Source: while ((fd = net_listen_unix(path, backlog)) == -1) {
    Source: fd = net_connect_unix(path);
M | 466 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 457 |  |
    Source: fd = net_connect_unix(path);
    Source: i_error("unlink(%s) failed: %m", path);
M | 457 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 452 |  |
    Source: while ((fd = net_listen_unix(path, backlog)) == -1) {
    Source: fd = net_connect_unix(path);
M | 466 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 457 |  |
    Source: fd = net_connect_unix(path);
    Source: i_error("unlink(%s) failed: %m", path);

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

net_accept (474 to 496 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 476 | Procedure contains UR data flow anomalies. : so.sa | CERT EXP33-C
| 483 |  |
    Source: ret = accept(fd, &so.sa, &addrlen);
    Source: union sockaddr_union so;
M | 476 | Procedure contains UR data flow anomalies. : so.sin | CERT EXP33-C
| 492 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;
M | 476 | Procedure contains UR data flow anomalies. : so.sin6 | CERT EXP33-C
| 492 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 476 | network.c | 483 | so.sa
    Source: union sockaddr_union so;
    Source: ret = accept(fd, &so.sa, &addrlen);
network.c | 476 | network.c | 492 | so.sin
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);
network.c | 476 | network.c | 493 | so.sin
    Source: union sockaddr_union so;
    Source: if (port != NULL) *port = sin_get_port(&so);
network.c | 476 | network.c | 492 | so.sin6
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);
network.c | 476 | network.c | 493 | so.sin6
    Source: union sockaddr_union so;
    Source: if (port != NULL) *port = sin_get_port(&so);

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

net_receive (498 to 523 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 503 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 502 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(len <= SSIZE_T_MAX);
M | 503 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 502 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(len <= SSIZE_T_MAX);

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

net_transmit (525 to 540 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 530 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 529 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(len <= SSIZE_T_MAX);
M | 530 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 529 |  |
    Source: i_assert(fd >= 0);
    Source: i_assert(len <= SSIZE_T_MAX);

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

net_gethostbyname (542 to 605 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 579 | Pointer not checked for null before use : so | CERT EXP08-C,EXP34-C
| 577 |  |
    Source: so = (union sockaddr_union *) ai->ai_addr;
    Source: sin_get_ip(so, &(*ips)[count]);
M | 579 | Pointer not checked for null before use : ips | CERT EXP08-C,EXP34-C
| 573 |  |
    Source: *ips = t_malloc(sizeof(struct ip_addr) * count);
    Source: sin_get_ip(so, &(*ips)[count]);
M | 576 | Pointer not checked for null before use : origai | CERT EXP08-C,EXP34-C
| 568 |  |
    Source: origai = ai;
    Source: for (ai = origai; ai != NULL; ai = ai->ai_next, count++) {

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

net_getsockname (607 to 622 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 609 | Procedure contains UR data flow anomalies. : so.sa | CERT EXP33-C
| 615 |  |
    Source: if (getsockname(fd, &so.sa, &addrlen) == -1)
    Source: union sockaddr_union so;
M | 609 | Procedure contains UR data flow anomalies. : so.sin | CERT EXP33-C
| 618 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;
M | 609 | Procedure contains UR data flow anomalies. : so.sin6 | CERT EXP33-C
| 618 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 609 | network.c | 615 | so.sa
    Source: union sockaddr_union so;
    Source: if (getsockname(fd, &so.sa, &addrlen) == -1)
network.c | 609 | network.c | 618 | so.sin
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);
network.c | 609 | network.c | 618 | so.sin6
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);

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

net_getpeername (624 to 639 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 626 | Procedure contains UR data flow anomalies. : so.sa | CERT EXP33-C
| 632 |  |
    Source: if (getpeername(fd, &so.sa, &addrlen) == -1)
    Source: union sockaddr_union so;
M | 626 | Procedure contains UR data flow anomalies. : so.sin | CERT EXP33-C
| 635 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;
M | 626 | Procedure contains UR data flow anomalies. : so.sin6 | CERT EXP33-C
| 635 |  |
    Source: if (addr != NULL) sin_get_ip(&so, addr);
    Source: union sockaddr_union so;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 626 | network.c | 632 | so.sa
    Source: union sockaddr_union so;
    Source: if (getpeername(fd, &so.sa, &addrlen) == -1)
network.c | 626 | network.c | 635 | so.sin
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);
network.c | 626 | network.c | 635 | so.sin6
    Source: union sockaddr_union so;
    Source: if (addr != NULL) sin_get_ip(&so, addr);

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

net_addr2ip (681 to 711 network.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 696 | Pointer not checked for null before use : addr | CERT EXP08-C,EXP34-C
| 694 |  |
    Source: addr = t_strndup(addr+1, len-2);
    Source: ret = inet_pton(AF_INET6, addr, &ip->u.ip6);
M | 697 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 689 |  |
    Source: T_BEGIN {
    Source: } T_END;
M | 694 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 689 |  |
    Source: T_BEGIN {
    Source: addr = t_strndup(addr+1, len-2);
M | 697 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 689 |  |
    Source: T_BEGIN {
    Source: } T_END;
M | 694 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 689 |  |
    Source: T_BEGIN {
    Source: addr = t_strndup(addr+1, len-2);

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

net_geterror (733 to 742 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 735 | Procedure contains UR data flow anomalies. : data | CERT EXP33-C
| 738 |  |
    Source: if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &data, &len) == -1)
    Source: int data;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 735 | network.c | 738 | data
    Source: int data;
    Source: if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &data, &len) == -1)

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

net_parse_range (819 to 843 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 829 | Pointer not checked for null before use : network | CERT EXP08-C,EXP34-C
| 827 |  |
    Source: network = t_strdup_until(network, p++);
    Source: if (net_addr2ip(network, ip_r) < 0)
M | 829 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 827 |  |
    Source: network = t_strdup_until(network, p++);
    Source: if (net_addr2ip(network, ip_r) < 0)
M | 829 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 827 |  |
    Source: network = t_strdup_until(network, p++);
    Source: if (net_addr2ip(network, ip_r) < 0)
M | 823 | Procedure contains UR data flow anomalies. : bits | CERT EXP33-C
| 838 |  |
    Source: if (str_to_uint(p, &bits) < 0 || bits > max_bits)
    Source: unsigned int bits, max_bits;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 823 | network.c | 838 | bits
    Source: unsigned int bits, max_bits;
    Source: if (str_to_uint(p, &bits) < 0 || bits > max_bits)

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

net_is_in_network (845 to 898 network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 882 | Pointer not checked for null before use : ip1 | CERT EXP08-C,EXP34-C
| 869 |  |
    Source: ip1 = (const void *)&ip->u.ip6;
    Source: i1 = htonl(ip1[i]);
M | 883 | Pointer not checked for null before use : ip2 | CERT EXP08-C,EXP34-C
| 870 |  |
    Source: ip2 = (const void *)&net_ip->u.ip6;
    Source: i2 = htonl(ip2[i]);
M | 848 | Procedure contains UR data flow anomalies. : tmp_ip.u.ip4 | CERT EXP33-C
| 853 |  |
    Source: if (net_ipv6_mapped_ipv4_convert(ip, &tmp_ip) == 0) {
    Source: struct ip_addr tmp_ip;
M | 848 | Procedure contains UR data flow anomalies. : tmp_ip.u.ip6 | CERT EXP33-C
| 869 |  |
    Source: ip1 = (const void *)&ip->u.ip6;
    Source: struct ip_addr tmp_ip;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
network.c | 848 | network.c | 853 | tmp_ip.u.ip4
    Source: struct ip_addr tmp_ip;
    Source: if (net_ipv6_mapped_ipv4_convert(ip, &tmp_ip) == 0) {
network.c | 848 | network.c | 869 | tmp_ip.u.ip6
    Source: struct ip_addr tmp_ip;
    Source: ip1 = (const void *)&ip->u.ip6;

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

nfs_safe_open (80 to 91 nfs-workarounds.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Local structure returned in function result : ctx |
    Source: return ctx.fd;
M | 87 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_assert((flags & O_CREAT) == 0);
    Source: if (nfs_safe_do(path, nfs_safe_open_callback, &ctx) < 0)
M | 87 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_assert((flags & O_CREAT) == 0);
    Source: if (nfs_safe_do(path, nfs_safe_open_callback, &ctx) < 0)
M | 82 | Procedure contains UR data flow anomalies. : ctx.fd | CERT EXP33-C
| 87 |  |
    Source: if (nfs_safe_do(path, nfs_safe_open_callback, &ctx) < 0)
    Source: struct nfs_safe_open_context ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
nfs-workarounds.c | 82 | nfs-workarounds.c | 87 | ctx.fd
    Source: struct nfs_safe_open_context ctx;
    Source: if (nfs_safe_do(path, nfs_safe_open_callback, &ctx) < 0)

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

nfs_safe_link (117 to 145 nfs-workarounds.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 125 | User input not checked before use. : st | CERT FIO30-C
| 123 |  |
    Source: if (stat(oldpath, &st) < 0)
    Source: orig_link_count = st.st_nlink;

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

nfs_flush_chown_uid (147 to 182 nfs-workarounds.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 157 | User input not checked before use. : st | CERT FIO30-C
| 156 |  |
    Source: if (stat(path, &st) == 0)
    Source: uid = st.st_uid;

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

nfs_flush_file_handle_cache_dir (290 to 353 nfs-workarounds.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 328 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: if (t_get_current_dir(&cur_path) < 0) {
    Source: i_error("nfs_flush_file_handle_cache_dir: "
M | 337 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: if (t_get_current_dir(&cur_path) < 0) {
    Source: cur_path = t_strdup_until(cur_path, p);
M | 339 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 337 |  |
    Source: cur_path = t_strdup_until(cur_path, p);
    Source: i_error("nfs_flush_file_handle_cache_dir: "
M | 344 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: i_error("nfs_flush_file_handle_cache_dir: "
    Source: i_error("fchdir() failed: %m");
M | 328 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: if (t_get_current_dir(&cur_path) < 0) {
    Source: i_error("nfs_flush_file_handle_cache_dir: "
M | 337 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: if (t_get_current_dir(&cur_path) < 0) {
    Source: cur_path = t_strdup_until(cur_path, p);
M | 339 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 337 |  |
    Source: cur_path = t_strdup_until(cur_path, p);
    Source: i_error("nfs_flush_file_handle_cache_dir: "
M | 344 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: i_error("nfs_flush_file_handle_cache_dir: "
    Source: i_error("fchdir() failed: %m");
M | 333 | Pointer not checked for null before use : cur_path | CERT EXP08-C,EXP34-C
| 327 |  |
    Source: if (t_get_current_dir(&cur_path) < 0) {
    Source: p = strrchr(cur_path, '/');
M | 338 | Pointer not checked for null before use : cur_path | CERT EXP08-C,EXP34-C
| 337 |  |
    Source: cur_path = t_strdup_until(cur_path, p);
    Source: if (chdir(cur_path) < 0) {
M | 342 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: i_error("nfs_flush_file_handle_cache_dir: "
    Source: ret = nfs_flush_file_handle_cache_dir(path, FALSE);
M | 342 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 339 |  |
    Source: i_error("nfs_flush_file_handle_cache_dir: "
    Source: ret = nfs_flush_file_handle_cache_dir(path, FALSE);
M | 317 | Procedure contains UR data flow anomalies. : cur_path | CERT EXP33-C
| 333 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: p = strrchr(cur_path, '/');
    Source: const char *cur_path, *p;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
nfs-workarounds.c | 317 | nfs-workarounds.c | 333 | cur_path
    Source: const char *cur_path, *p;
    Source: p = strrchr(cur_path, '/');

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

nfs_flush_file_handle_cache_parent_dir (355 to 367 nfs-workarounds.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 366 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
    Source: } T_END;
M | 362 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: T_BEGIN {
    Source: nfs_flush_file_handle_cache_dir(".", TRUE);
M | 364 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: T_BEGIN {
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
M | 366 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
    Source: } T_END;
M | 362 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: T_BEGIN {
    Source: nfs_flush_file_handle_cache_dir(".", TRUE);
M | 364 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: T_BEGIN {
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
M | 364 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
M | 364 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),
    Source: nfs_flush_file_handle_cache_dir(t_strdup_until(path, p),

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

o_stream_create_buffer (51 to 63 ostream-buffer.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 56 | Pointer not checked for null before use : bstream | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: bstream = i_new(struct buffer_ostream, 1);
    Source: bstream->ostream.max_buffer_size = (size_t)-1;
M | 55 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 695) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\OSTREAM-BUFFER_695.ref" looking for line -1105
    Source: bstream = i_new(struct buffer_ostream, 1);

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

stream_closed (54 to 68 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 61 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 57 |  |
    Source: io_remove(&fstream->io);
    Source: i_error("file_ostream.close(%s) failed: %m",
M | 61 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 57 |  |
    Source: io_remove(&fstream->io);
    Source: i_error("file_ostream.close(%s) failed: %m",

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

o_stream_file_close (70 to 78 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: o_stream_flush(&fstream->ostream.ostream);
    Source: stream_closed(fstream);
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: o_stream_flush(&fstream->ostream.ostream);
    Source: stream_closed(fstream);

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

o_stream_file_destroy (80 to 85 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 84 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 696) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\OSTREAM-FILE_696.ref" looking for line -1105
    Source: i_free(fstream->buffer);

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

file_buffer_get_used_size (87 to 99 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 90 | Local structure returned in function result : fstream |
    Source: return fstream->full ? fstream->buffer_size : 0;
M | 93 | Local structure returned in function result : fstream |
    Source: return fstream->tail - fstream->head;

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

o_stream_writev (166 to 278 ostream-file.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 247 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 249 |  |
    Source: iov++;
    Source: while (iov_size > 0 && size >= iov->iov_len) {
M | 194 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: iov += IOV_MAX;
    Source: size += iov[i].iov_len;
M | 254 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 249 |  |
    Source: iov++;
    Source: ret2 = o_stream_writev(fstream, iov, iov_size);
M | 215 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 206 |  |
    Source: iov += IOV_MAX;
    Source: ret = writev(fstream->fd, (const struct iovec *)iov,
M | 264 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_assert(iov_size > 0);
    Source: i_assert((size_t)ret2 == new_iov.iov_len);
M | 264 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_assert(iov_size > 0);
    Source: i_assert((size_t)ret2 == new_iov.iov_len);
M | 262 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_assert(iov_size > 0);
    Source: ret2 = o_stream_writev(fstream, &new_iov, 1);
M | 268 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 264 |  |
    Source: i_assert((size_t)ret2 == new_iov.iov_len);
    Source: ret2 = o_stream_writev(fstream, iov + 1,
M | 262 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 252 |  |
    Source: i_assert(iov_size > 0);
    Source: ret2 = o_stream_writev(fstream, &new_iov, 1);
M | 268 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 264 |  |
    Source: i_assert((size_t)ret2 == new_iov.iov_len);
    Source: ret2 = o_stream_writev(fstream, iov + 1,
M | 169 | Procedure contains UR data flow anomalies. : ret | CERT EXP33-C
| 219 |  |
    Source: if (ret > 0) {
    Source: ssize_t ret, ret2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
ostream-file.c | 169 | ostream-file.c | 219 | ret
    Source: ssize_t ret, ret2;
    Source: if (ret > 0) {

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

buffer_flush (304 to 320 ostream-file.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 312 | Pointer not checked for null before use : iov.iov_base | CERT EXP08-C,EXP34-C
| 310 |  |
    Source: iov_len = o_stream_fill_iovec(fstream, iov);
    Source: ret = o_stream_writev(fstream, iov, iov_len);
M | 316 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_len);
    Source: update_buffer(fstream, ret);
M | 316 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 312 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_len);
    Source: update_buffer(fstream, ret);
M | 306 | Procedure contains UR data flow anomalies. : iov.iov_base | CERT EXP33-C
| 312 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_len);
    Source: struct const_iovec iov[2];
M | 306 | Procedure contains UR data flow anomalies. : iov.iov_len | CERT EXP33-C
| 312 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_len);
    Source: struct const_iovec iov[2];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
ostream-file.c | 306 | ostream-file.c | 312 | iov.iov_base
    Source: struct const_iovec iov[2];
    Source: ret = o_stream_writev(fstream, iov, iov_len);
ostream-file.c | 306 | ostream-file.c | 312 | iov.iov_len
    Source: struct const_iovec iov[2];
    Source: ret = o_stream_writev(fstream, iov, iov_len);

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

o_stream_file_cork (322 to 349 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 342 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: io_remove(&fstream->io);
    Source: i_assert(!set);
M | 342 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: io_remove(&fstream->io);
    Source: i_assert(!set);

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

get_unused_space (370 to 382 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 374 | Local structure returned in function result : fstream |
    Source: return fstream->head - fstream->tail;
M | 377 | Local structure returned in function result : fstream |
    Source: return (fstream->buffer_size - fstream->tail) + fstream->head;

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

o_stream_grow_buffer (409 to 441 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 428 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 413 |  |
    Source: size = nearest_power(fstream->buffer_size + bytes);
    Source: fstream->buffer = i_realloc(fstream->buffer,

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

stream_send_io (443 to 479 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 478 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 466 |  |
    Source: io_remove(&fstream->io);
    Source: o_stream_unref(&ostream);
M | 478 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 466 |  |
    Source: io_remove(&fstream->io);
    Source: o_stream_unref(&ostream);

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

o_stream_file_sendv (520 to 585 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 549 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 550 |  |
    Source: iov++;
    Source: size -= iov[0].iov_len;
M | 576 | Pointer not checked for null before use : iov | CERT EXP08-C,EXP34-C
| 569 |  |
    Source: iov++;
    Source: added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
M | 582 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 576 |  |
    Source: added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
    Source: i_assert((size_t)ret <= total_size);
M | 583 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 582 |  |
    Source: i_assert((size_t)ret <= total_size);
    Source: i_assert((size_t)ret == total_size || !fstream->file);
M | 558 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 543 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_count);
    Source: added = o_stream_add(fstream,
M | 576 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 555 |  |
    Source: i_assert(size == 0);
    Source: added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
M | 543 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 534 |  |
    Source: if (o_stream_file_flush(stream) < 0)
    Source: ret = o_stream_writev(fstream, iov, iov_count);
M | 582 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 576 |  |
    Source: added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
    Source: i_assert((size_t)ret <= total_size);
M | 583 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 582 |  |
    Source: i_assert((size_t)ret <= total_size);
    Source: i_assert((size_t)ret == total_size || !fstream->file);
M | 558 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 543 |  |
    Source: ret = o_stream_writev(fstream, iov, iov_count);
    Source: added = o_stream_add(fstream,
M | 576 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 555 |  |
    Source: i_assert(size == 0);
    Source: added = o_stream_add(fstream, iov[i].iov_base, iov[i].iov_len);
M | 543 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 534 |  |
    Source: if (o_stream_file_flush(stream) < 0)
    Source: ret = o_stream_writev(fstream, iov, iov_count);

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

o_stream_file_update_buffer (587 to 613 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 609 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 603 |  |
    Source: data = CONST_PTR_OFFSET(data, copy_size);
    Source: memcpy(fstream->buffer, data, copy_size);

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

o_stream_file_write_at (615 to 669 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 663 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 644 |  |
    Source: data = CONST_PTR_OFFSET(data, skip);
    Source: if (pwrite_full(fstream->fd, data, size, offset) < 0) {
M | 665 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 660 |  |
    Source: if (o_stream_file_flush(stream) < 0)
    Source: stream_closed(fstream);
M | 660 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 634 |  |
    Source: left = o_stream_file_update_buffer(fstream,
    Source: if (o_stream_file_flush(stream) < 0)
M | 665 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 660 |  |
    Source: if (o_stream_file_flush(stream) < 0)
    Source: stream_closed(fstream);
M | 660 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 634 |  |
    Source: left = o_stream_file_update_buffer(fstream,
    Source: if (o_stream_file_flush(stream) < 0)

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

io_stream_sendfile (671 to 730 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 701 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 690 |  |
    Source: if ((ret = buffer_flush(foutstream)) <= 0)
    Source: ret = safe_sendfile(foutstream->fd, in_fd, &offset,
M | 727 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 713 |  |
    Source: stream_closed(foutstream);
    Source: (void)i_stream_read(instream);
M | 701 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 690 |  |
    Source: if ((ret = buffer_flush(foutstream)) <= 0)
    Source: ret = safe_sendfile(foutstream->fd, in_fd, &offset,
M | 727 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 713 |  |
    Source: stream_closed(foutstream);
    Source: (void)i_stream_read(instream);

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

io_stream_copy_backwards (732 to 807 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 796 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 783 |  |
    Source: data = foutstream->buffer;
    Source: ret = pwrite_full(foutstream->fd, data, size, out_offset);
M | 773 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 768 |  |
    Source: i_assert(in_offset <= in_limit);
    Source: (void)i_stream_read_data(instream, &data, &size,
M | 780 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 773 |  |
    Source: (void)i_stream_read_data(instream, &data, &size,
    Source: i_assert(size <=
M | 747 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 741 |  |
    Source: i_assert(IS_STREAM_EMPTY(foutstream));
    Source: o_stream_grow_buffer(foutstream,
M | 773 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 768 |  |
    Source: i_assert(in_offset <= in_limit);
    Source: (void)i_stream_read_data(instream, &data, &size,
M | 780 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 773 |  |
    Source: (void)i_stream_read_data(instream, &data, &size,
    Source: i_assert(size <=
M | 747 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 741 |  |
    Source: i_assert(IS_STREAM_EMPTY(foutstream));
    Source: o_stream_grow_buffer(foutstream,

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

io_stream_copy_stream (809 to 844 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 837 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 836 |  |
    Source: i_assert(instream->seekable);
    Source: return io_stream_copy_backwards(outstream, instream,
M | 842 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 824 |  |
    Source: i_assert(instream->v_offset <= (uoff_t)st->st_size);
    Source: return io_stream_copy(&outstream->ostream, instream,
M | 837 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 836 |  |
    Source: i_assert(instream->seekable);
    Source: return io_stream_copy_backwards(outstream, instream,
M | 842 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 824 |  |
    Source: i_assert(instream->v_offset <= (uoff_t)st->st_size);
    Source: return io_stream_copy(&outstream->ostream, instream,

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

o_stream_file_send_istream (846 to 869 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 868 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 857 |  |
    Source: ret = io_stream_sendfile(outstream, instream, in_fd);
    Source: return io_stream_copy_stream(outstream, instream, same_stream);
M | 868 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 857 |  |
    Source: ret = io_stream_sendfile(outstream, instream, in_fd);
    Source: return io_stream_copy_stream(outstream, instream, same_stream);
M | 868 | Pointer not checked for null before use : (outstream)->ostream.offset | CERT EXP08-C,EXP34-C
| 857 |  |
    Source: ret = io_stream_sendfile(outstream, instream, in_fd);
    Source: return io_stream_copy_stream(outstream, instream, same_stream);

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

o_stream_create_fd_common (871 to 894 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 893 | Local structure returned in function result : fstream |
    Source: return fstream;
M | 876 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 696) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\OSTREAM-FILE_696.ref" looking for line -1105
    Source: fstream = i_new(struct file_ostream, 1);

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

o_stream_create_fd (916 to 944 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 934 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: if (net_getsockname(fd, NULL, NULL) < 0) {

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

o_stream_create_fd_file (946 to 964 ostream-file.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 963 | Local structure returned in function result : ostream |
    Source: return ostream;

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

o_stream_set_name (7 to 11 ostream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 9 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(stream->real_stream->iostream.name);
M | 10 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 9 |  |
    Source: i_free(stream->real_stream->iostream.name);
    Source: stream->real_stream->iostream.name = i_strdup(name);
M | 10 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: stream->real_stream->iostream.name = i_strdup(name);
M | 9 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 697) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\OSTREAM_697.ref" looking for line -1105
    Source: i_free(stream->real_stream->iostream.name);

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

io_stream_copy (263 to 294 ostream.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 281 | Pointer not checked for null before use : iov.iov_base | CERT EXP08-C,EXP34-C
| 280 |  |
    Source: iov.iov_base = data;
    Source: ret = o_stream_sendv(outstream, &iov, 1);
M | 280 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 273 |  |
    Source: (void)i_stream_read_data(instream, &data, &iov.iov_len,
    Source: iov.iov_base = data;
M | 281 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 273 |  |
    Source: (void)i_stream_read_data(instream, &data, &iov.iov_len,
    Source: ret = o_stream_sendv(outstream, &iov, 1);
M | 273 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 281 |  |
    Source: ret = o_stream_sendv(outstream, &iov, 1);
    Source: (void)i_stream_read_data(instream, &data, &iov.iov_len,
M | 281 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 273 |  |
    Source: (void)i_stream_read_data(instream, &data, &iov.iov_len,
    Source: ret = o_stream_sendv(outstream, &iov, 1);
M | 273 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 281 |  |
    Source: ret = o_stream_sendv(outstream, &iov, 1);
    Source: (void)i_stream_read_data(instream, &data, &iov.iov_len,

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

fix_format_real (6 to 32 printf-format-fix.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Pointer not checked for null before use : errstr | CERT EXP08-C,EXP34-C
| 15 |  |
    Source: errstr = strerror(errno);
    Source: len2 = strlen(errstr);
M | 25 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 13 |  |
    Source: i_assert((size_t)(p - fmt) < INT_MAX);
    Source: buf = t_buffer_get(len1 + len2 + len3 + 1);
M | 25 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 13 |  |
    Source: i_assert((size_t)(p - fmt) < INT_MAX);
    Source: buf = t_buffer_get(len1 + len2 + len3 + 1);

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

printf_format_fix_noalloc (34 to 54 printf-format-fix.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: i_panic("%%n modifier used");
    Source: return fix_format_real(format, p-1, len_r);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: i_panic("%%n modifier used");
    Source: return fix_format_real(format, p-1, len_r);

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

printf_format_fix_get_len (56 to 64 printf-format-fix.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 62 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: ret = printf_format_fix_noalloc(format, len_r);
    Source: t_buffer_alloc(*len_r + 1);
M | 62 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: ret = printf_format_fix_noalloc(format, len_r);
    Source: t_buffer_alloc(*len_r + 1);

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

printf_format_fix (66 to 75 printf-format-fix.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: ret = printf_format_fix_noalloc(format, &len);
    Source: t_buffer_alloc(len + 1);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: ret = printf_format_fix_noalloc(format, &len);
    Source: t_buffer_alloc(len + 1);

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

priorityq_init (22 to 31 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Local structure returned in function result : pq |
    Source: return pq;
M | 28 | Pointer not checked for null before use : pq | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: pq = i_new(struct priorityq, 1);
    Source: pq->cmp_callback = cmp_callback;
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: i_array_init(&pq->items, init_size);
    Source: i_array_init(&pq->items, init_size);
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 700) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\PRIORITYQ_700.ref" looking for line -1105
    Source: pq = i_new(struct priorityq, 1);

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

priorityq_deinit (33 to 40 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 39 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 700) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\PRIORITYQ_700.ref" looking for line -1105
    Source: i_free(pq);

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

heap_items_swap (47 to 63 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 62 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: tmp = items[idx1];
    Source: items[idx2] = tmp;
M | 54 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: i_assert(items[idx1]->idx == idx1);
    Source: i_assert(items[idx2]->idx == idx2);
M | 54 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: i_assert(items[idx1]->idx == idx1);
    Source: i_assert(items[idx2]->idx == idx2);

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

heap_item_bubble_up (65 to 84 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 76 | Pointer not checked for null before use : items | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: items = array_get_modifiable(&pq->items, &count);
    Source: if (pq->cmp_callback(items[idx], items[parent_idx]) >= 0)
M | 80 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: i_assert(idx < count);
    Source: heap_items_swap(items, idx, parent_idx);
M | 75 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: heap_items_swap(items, idx, parent_idx);
    Source: i_assert(idx < count);
M | 80 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: i_assert(idx < count);
    Source: heap_items_swap(items, idx, parent_idx);
M | 75 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: heap_items_swap(items, idx, parent_idx);
    Source: i_assert(idx < count);

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

heap_item_bubble_down (86 to 107 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 95 | Pointer not checked for null before use : items | CERT EXP08-C,EXP34-C
| 91 |  |
    Source: items = array_get_modifiable(&pq->items, &count);
    Source: pq->cmp_callback(items[left_idx], items[right_idx]) < 0)
M | 100 | Pointer not checked for null before use : items | CERT EXP08-C,EXP34-C
| 91 |  |
    Source: items = array_get_modifiable(&pq->items, &count);
    Source: if (pq->cmp_callback(items[min_child_idx], items[idx]) >= 0)

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

priorityq_add (109 to 114 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 113 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 112 |  |
    Source: array_append(&pq->items, &item, 1);
    Source: (void)heap_item_bubble_up(pq, item->idx);
M | 113 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 112 |  |
    Source: array_append(&pq->items, &item, 1);
    Source: (void)heap_item_bubble_up(pq, item->idx);

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

priorityq_remove_idx (116 to 134 priorityq.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 127 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: heap_items_swap(items, idx, count);
    Source: array_delete(&pq->items, count, 1);
M | 127 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: heap_items_swap(items, idx, count);
    Source: array_delete(&pq->items, count, 1);
M | 126 | Pointer not checked for null before use : items | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: items = array_get_modifiable(&pq->items, &count);
    Source: heap_items_swap(items, idx, count);
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 122 |  |
    Source: i_assert(idx < count);
    Source: heap_items_swap(items, idx, count);
M | 132 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: idx = heap_item_bubble_up(pq, idx);
    Source: heap_item_bubble_down(pq, idx);
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 122 |  |
    Source: i_assert(idx < count);
    Source: heap_items_swap(items, idx, count);
M | 132 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 131 |  |
    Source: idx = heap_item_bubble_up(pq, idx);
    Source: heap_item_bubble_down(pq, idx);

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

proctitle_hack_init (23 to 54 process-title.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 37 | Pointer not checked for null before use : last | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: last = argv[0] + strlen(argv[0]) + 1;
    Source: clear_env = last == env[0];
M | 44 | Pointer not checked for null before use : last | CERT EXP08-C,EXP34-C
| 40 |  |
    Source: last = env[i] + strlen(env[i]) + 1;
    Source: process_title_len = last - argv[0];
M | 50 | Pointer not checked for null before use : process_title | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: process_title = argv[0];
    Source: process_title_clean_pos = env[0] - process_title;

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

argv_dup (56 to 86 process-title.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 81 | Pointer not checked for null before use : memblock | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: memcpy(memblock, old_argv[i], len);
    Source: memblock = PTR_OFFSET(memblock, len);
M | 78 | Pointer not checked for null before use : memblock | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: memblock = PTR_OFFSET(memblock, sizeof(char *) * (count + 1));
    Source: new_argv[i] = memblock;
M | 86 | Memory not freed after last reference. : memblock | CERT MEM00-C
    Source: }
M | 83 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: i_fatal_status(FATAL_OUTOFMEM, "malloc() failed: %m");
    Source: i_assert(memblock == memblock_end);
M | 83 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: i_fatal_status(FATAL_OUTOFMEM, "malloc() failed: %m");
    Source: i_assert(memblock == memblock_end);

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

process_title_init (111 to 123 process-title.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 119 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: *argv = argv_dup(orig_argv, &argv_memblock);
    Source: environ = argv_dup(orig_environ, &environ_memblock);
M | 119 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 118 |  |
    Source: *argv = argv_dup(orig_argv, &argv_memblock);
    Source: environ = argv_dup(orig_environ, &environ_memblock);
M | 116 | Pointer not checked for null before use : environ | CERT EXP08-C,EXP34-C
| Ref. Line -1686 (Module 701) |  |
    Ref(-1686)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\PROCESS-TITLE_701.ref" looking for line -1686
    Source: char **orig_environ = environ;

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

process_title_set (125 to 137 process-title.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 135 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 127 |  |
    Source: i_assert(process_name != NULL);
    Source: proctitle_hack_set(t_strconcat(process_name, " ", title, NULL));
M | 135 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 127 |  |
    Source: i_assert(process_name != NULL);
    Source: proctitle_hack_set(t_strconcat(process_name, " ", title, NULL));

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

process_title_deinit (139 to 145 process-title.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 142 | free parameter is not heap item. | CERT MEM34-C
    Source: free(argv_memblock);
M | 143 | free parameter is not heap item. | CERT MEM34-C
    Source: free(environ_memblock);

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

random_fill (17 to 36 randgen.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: i_assert(init_refcount > 0);
    Source: i_assert(size < SSIZE_T_MAX);
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: i_assert(size < SSIZE_T_MAX);
    Source: i_fatal("EOF when reading from "DEV_URANDOM_PATH);
M | 23 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: i_assert(init_refcount > 0);
    Source: i_assert(size < SSIZE_T_MAX);
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: i_assert(size < SSIZE_T_MAX);
    Source: i_fatal("EOF when reading from "DEV_URANDOM_PATH);

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

random_init (38 to 59 randgen.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 58 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: random_fill(&seed, sizeof(seed));
    Source: fd_close_on_exec(urandom_fd, TRUE);
M | 58 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: random_fill(&seed, sizeof(seed));
    Source: fd_close_on_exec(urandom_fd, TRUE);
M | 55 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("Can't open "DEV_URANDOM_PATH": %m");
    Source: random_fill(&seed, sizeof(seed));
M | 55 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("Can't open "DEV_URANDOM_PATH": %m");
    Source: random_fill(&seed, sizeof(seed));
M | 40 | Procedure contains UR data flow anomalies. : seed | CERT EXP33-C
| 56 |  |
    Source: srand(seed);
    Source: unsigned int seed;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
randgen.c | 40 | randgen.c | 56 | seed
    Source: unsigned int seed;
    Source: srand(seed);

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

read_full (8 to 22 read-full.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 17 | User input not checked before use. : data | CERT FIO30-C
| 13 |  |
    Source: ret = read(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX);
    Source: data = PTR_OFFSET(data, ret);
M | 17 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 13 |  |
    Source: ret = read(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX);
    Source: data = PTR_OFFSET(data, ret);

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

pread_full (24 to 40 read-full.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: data = PTR_OFFSET(data, ret);
    Source: ret = pread(fd, data, size < SSIZE_T_MAX ?

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

restrict_access_init (25 to 32 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : set | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: memset(set, 0, sizeof(*set));
    Source: set->uid = (uid_t)-1;

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

restrict_init_groups (64 to 113 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: i_fatal("setgid(%s) failed with "
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: i_fatal("setgid(%s) failed with "
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
M | 78 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
M | 78 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()),
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
M | 78 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
M | 78 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
M | 79 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
M | 79 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()),
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
M | 79 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
M | 79 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
    Source: get_gid_str(primary_gid), get_uid_str(geteuid()));
M | 94 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 93 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_fatal("setresgid(%s,%s,%s) failed with euid=%s: %m",
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
M | 94 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: i_fatal("setresgid(%s,%s,%s) failed with euid=%s: %m",
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
M | 94 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
M | 94 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
M | 95 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));
M | 95 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: get_gid_str(primary_gid), get_gid_str(primary_gid),
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));
M | 95 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));
M | 95 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));
    Source: get_gid_str(privileged_gid), get_uid_str(geteuid()));

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

restrict_get_groups_list (115 to 130 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 124 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: i_fatal("getgroups() failed: %m");
    Source: gid_list = t_new(gid_t, gid_count);
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: gid_list = t_new(gid_t, gid_count);
    Source: i_fatal("getgroups() failed: %m");
M | 124 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: i_fatal("getgroups() failed: %m");
    Source: gid_list = t_new(gid_t, gid_count);
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: gid_list = t_new(gid_t, gid_count);
    Source: i_fatal("getgroups() failed: %m");

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

get_group_id (151 to 163 restrict-access.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 154 | Procedure contains UR data flow anomalies. : gid | CERT EXP33-C
| 157 |  |
    Source: return gid;
    Source: gid_t gid;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
restrict-access.c | 154 | restrict-access.c | 157 | gid
    Source: gid_t gid;
    Source: return gid;

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

fix_groups_list (165 to 228 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 184 | Pointer not checked for null before use : gid_list | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: gid_list = restrict_get_groups_list(&gid_count);
    Source: have_root_group);
M | 208 | Pointer not checked for null before use : gid_list2 | CERT EXP08-C,EXP34-C
| 207 |  |
    Source: gid_list2 = t_new(gid_t, gid_count + str_array_length(tmp) + 1);
    Source: memcpy(gid_list2, gid_list, gid_count * sizeof(gid_t));
M | 208 | Pointer not checked for null before use : gid_list | CERT EXP08-C,EXP34-C
| 200 |  |
    Source: gid_list[0] = process_primary_gid;
    Source: memcpy(gid_list2, gid_list, gid_count * sizeof(gid_t));
M | 216 | Pointer not checked for null before use : gid_list2 | CERT EXP08-C,EXP34-C
| 215 |  |
    Source: gid_list2[gid_count++] = process_primary_gid;
    Source: gid_list = gid_list2;
M | 209 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 209 |  |
    Source: for (; *tmp != NULL; tmp++) {
    Source: for (; *tmp != NULL; tmp++) {
M | 205 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 178 |  |
    Source: tmp = set->extra_groups == NULL ? &empty :
    Source: if (*tmp != NULL || add_primary_gid) {
M | 210 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 207 |  |
    Source: gid_list2 = t_new(gid_t, gid_count + str_array_length(tmp) + 1);
    Source: gid = get_group_id(*tmp);
M | 182 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 179 |  |
    Source: t_strsplit_spaces(set->extra_groups, ", ");
    Source: gid_list = restrict_get_groups_list(&gid_count);
M | 207 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: gid_list = t_new(gid_t, 2);
    Source: gid_list2 = t_new(gid_t, gid_count + str_array_length(tmp) + 1);
M | 199 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: gid_list = restrict_get_groups_list(&gid_count);
    Source: gid_list = t_new(gid_t, 2);
M | 225 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: gid_list = t_new(gid_t, 2);
    Source: i_fatal("setgroups() failed: %m");
M | 210 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 207 |  |
    Source: gid_list2 = t_new(gid_t, gid_count + str_array_length(tmp) + 1);
    Source: gid = get_group_id(*tmp);
M | 182 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 179 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: t_strsplit_spaces(set->extra_groups, ", ");
    Source: gid_list = restrict_get_groups_list(&gid_count);
M | 207 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: gid_list = t_new(gid_t, 2);
    Source: gid_list2 = t_new(gid_t, gid_count + str_array_length(tmp) + 1);
M | 199 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 182 |  |
    Source: gid_list = restrict_get_groups_list(&gid_count);
    Source: gid_list = t_new(gid_t, 2);
M | 225 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: gid_list = t_new(gid_t, 2);
    Source: i_fatal("setgroups() failed: %m");

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

restrict_access (230 to 335 restrict-access.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 260 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: i_fatal("initgroups(%s, %s) failed: %m",
    Source: get_gid_str(process_primary_gid));
M | 260 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 258 |  |
    Source: i_fatal("initgroups(%s, %s) failed: %m",
    Source: get_gid_str(process_primary_gid));
M | 268 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 267 |  |
    Source: if (is_root) T_BEGIN {
    Source: fix_groups_list(set, preserve_groups,
M | 268 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 267 |  |
    Source: if (is_root) T_BEGIN {
    Source: fix_groups_list(set, preserve_groups,
M | 270 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 268 |  |
    Source: fix_groups_list(set, preserve_groups,
    Source: } T_END;
M | 270 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 268 |  |
    Source: fix_groups_list(set, preserve_groups,
    Source: } T_END;
M | 301 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 298 |  |
    Source: i_fatal("setuid(%s) failed with euid=%s: %m "
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
M | 301 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 298 |  |
    Source: i_fatal("setuid(%s) failed with euid=%s: %m "
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
M | 301 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 301 |  |
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
M | 301 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 301 |  |
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
M | 302 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 301 |  |
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
M | 302 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 301 |  |
    Source: get_uid_str(set->uid), get_uid_str(geteuid()),
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
M | 302 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 302 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
M | 302 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 302 |  |
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
    Source: get_uid_str(set->uid), get_uid_str(geteuid()));
M | 331 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: i_fatal("We couldn't drop root group privileges "
    Source: get_gid_str(process_primary_gid),
M | 331 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 329 |  |
    Source: i_fatal("We couldn't drop root group privileges "
    Source: get_gid_str(process_primary_gid),
M | 332 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 331 |  |
    Source: get_gid_str(process_primary_gid),
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
M | 332 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 331 |  |
    Source: get_gid_str(process_primary_gid),
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
M | 332 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 332 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
M | 332 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 332 |  |
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
    Source: get_gid_str(getgid()), get_gid_str(getegid()));
M | 281 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 280 |  |
    Source: i_fatal("chroot(%s) failed: %m", set->chroot_dir);
    Source: chroot_dir = i_strdup(set->chroot_dir);
M | 313 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 311 |  |
    Source: i_fatal("This process must not be run as root");
    Source: i_fatal("We couldn't drop root privileges");
M | 329 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 328 |  |
    Source: i_fatal("GID 0 isn't permitted");
    Source: i_fatal("We couldn't drop root group privileges "
M | 267 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 260 |  |
    Source: get_gid_str(process_primary_gid));
    Source: if (is_root) T_BEGIN {
M | 291 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 285 |  |
    Source: i_error("chdir(%s) failed: %m", home);
    Source: i_fatal("chdir(/) failed: %m");

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 298 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 291 |  |
    Source: i_fatal("chdir(/) failed: %m");
    Source: i_fatal("setuid(%s) failed with euid=%s: %m "
M | 313 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 311 |  |
    Source: i_fatal("This process must not be run as root");
    Source: i_fatal("We couldn't drop root privileges");
M | 329 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 328 |  |
    Source: i_fatal("GID 0 isn't permitted");
    Source: i_fatal("We couldn't drop root group privileges "
M | 267 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 260 |  |
    Source: get_gid_str(process_primary_gid));
    Source: if (is_root) T_BEGIN {
M | 280 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 270 |  |
    Source: } T_END;
    Source: i_fatal("chroot(%s) failed: %m", set->chroot_dir);
M | 285 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 280 |  |
    Source: i_fatal("chroot(%s) failed: %m", set->chroot_dir);
    Source: i_error("chdir(%s) failed: %m", home);
M | 291 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 280 |  |
    Source: i_fatal("chroot(%s) failed: %m", set->chroot_dir);
    Source: i_fatal("chdir(/) failed: %m");
M | 298 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 291 |  |
    Source: i_fatal("chdir(/) failed: %m");
    Source: i_fatal("setuid(%s) failed with euid=%s: %m "
M | 286 | Procedure contains UR data flow anomalies. : home | CERT EXP33-C
    Source: home = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
restrict-access.c | 286 | restrict-access.c | 289 | home
    Source: home = NULL;
    Source: if (home == NULL) {

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

restrict_access_set_env (337 to 372 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 348 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
M | 348 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
M | 352 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
M | 352 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
M | 356 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 356 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
M | 356 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 356 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
M | 365 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
M | 365 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
M | 369 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 369 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
M | 369 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 369 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
M | 348 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 345 |  |
    Source: env_put(t_strconcat("RESTRICT_CHROOT=", set->chroot_dir, NULL));
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
M | 352 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
M | 356 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 352 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
M | 365 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: env_put(t_strconcat("RESTRICT_SETEXTRAGROUPS=",
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
M | 369 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
M | 345 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 341 |  |
    Source: env_put(t_strconcat("RESTRICT_USER=",
    Source: env_put(t_strconcat("RESTRICT_CHROOT=", set->chroot_dir, NULL));
M | 360 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 356 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
    Source: env_put(t_strconcat("RESTRICT_SETEXTRAGROUPS=",
M | 348 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 345 |  |
    Source: env_put(t_strconcat("RESTRICT_CHROOT=", set->chroot_dir, NULL));
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
M | 352 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETUID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
M | 356 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 352 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID=%s",
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
M | 365 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 360 |  |
    Source: env_put(t_strconcat("RESTRICT_SETEXTRAGROUPS=",
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
M | 369 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: env_put(t_strdup_printf("RESTRICT_GID_FIRST=%s",
    Source: env_put(t_strdup_printf("RESTRICT_GID_LAST=%s",
M | 345 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 341 |  |
    Source: env_put(t_strconcat("RESTRICT_USER=",
    Source: env_put(t_strconcat("RESTRICT_CHROOT=", set->chroot_dir, NULL));
M | 360 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 356 |  |
    Source: env_put(t_strdup_printf("RESTRICT_SETGID_PRIV=%s",
    Source: env_put(t_strconcat("RESTRICT_SETEXTRAGROUPS=",

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

restrict_access_get_env (379 to 408 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 390 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 386 |  |
    Source: i_fatal("Invalid uid: %s", value);
    Source: i_fatal("Invalid gid: %s", value);
M | 394 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 390 |  |
    Source: i_fatal("Invalid gid: %s", value);
    Source: i_fatal("Invalid privileged_gid: %s", value);
M | 398 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 394 |  |
    Source: i_fatal("Invalid privileged_gid: %s", value);
    Source: i_fatal("Invalid first_valid_gid: %s", value);
M | 402 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 398 |  |
    Source: i_fatal("Invalid first_valid_gid: %s", value);
    Source: i_fatal("Invalid last_value_gid: %s", value);
M | 390 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 386 |  |
    Source: i_fatal("Invalid uid: %s", value);
    Source: i_fatal("Invalid gid: %s", value);
M | 394 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 390 |  |
    Source: i_fatal("Invalid gid: %s", value);
    Source: i_fatal("Invalid privileged_gid: %s", value);
M | 398 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 394 |  |
    Source: i_fatal("Invalid privileged_gid: %s", value);
    Source: i_fatal("Invalid first_valid_gid: %s", value);
M | 402 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 398 |  |
    Source: i_fatal("Invalid first_valid_gid: %s", value);
    Source: i_fatal("Invalid last_value_gid: %s", value);

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

restrict_access_by_env (410 to 431 restrict-access.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 415 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 414 |  |
    Source: restrict_access_get_env(&set);
    Source: restrict_access(&set, home, disallow_root);
M | 415 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 414 |  |
    Source: restrict_access_get_env(&set);
    Source: restrict_access(&set, home, disallow_root);
M | 415 | Pointer not checked for null before use : set.extra_groups | CERT EXP08-C,EXP34-C
| 414 |  |
    Source: restrict_access_get_env(&set);
    Source: restrict_access(&set, home, disallow_root);
M | 418 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 415 |  |
    Source: restrict_access(&set, home, disallow_root);
    Source: env_remove("RESTRICT_SETUID");
M | 418 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 415 |  |
    Source: restrict_access(&set, home, disallow_root);
    Source: env_remove("RESTRICT_SETUID");
M | 424 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 423 |  |
    Source: env_remove("RESTRICT_SETGID");
    Source: env_remove("RESTRICT_SETGID_PRIV");
M | 424 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 423 |  |
    Source: env_remove("RESTRICT_SETGID");
    Source: env_remove("RESTRICT_SETGID_PRIV");
M | 427 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 426 |  |
    Source: env_remove("RESTRICT_GID_FIRST");
    Source: env_remove("RESTRICT_GID_LAST");
M | 427 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 426 |  |
    Source: env_remove("RESTRICT_GID_FIRST");
    Source: env_remove("RESTRICT_GID_LAST");
M | 428 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 427 |  |
    Source: env_remove("RESTRICT_GID_LAST");
    Source: env_remove("RESTRICT_SETEXTRAGROUPS");
M | 428 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 427 |  |
    Source: env_remove("RESTRICT_GID_LAST");
    Source: env_remove("RESTRICT_SETEXTRAGROUPS");
M | 429 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 428 |  |
    Source: env_remove("RESTRICT_SETEXTRAGROUPS");
    Source: env_remove("RESTRICT_USER");
M | 429 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 428 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: env_remove("RESTRICT_SETEXTRAGROUPS");
    Source: env_remove("RESTRICT_USER");
M | 430 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 429 |  |
    Source: env_remove("RESTRICT_USER");
    Source: env_remove("RESTRICT_CHROOT");
M | 430 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 429 |  |
    Source: env_remove("RESTRICT_USER");
    Source: env_remove("RESTRICT_CHROOT");
M | 426 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 424 |  |
    Source: env_remove("RESTRICT_SETGID_PRIV");
    Source: env_remove("RESTRICT_GID_FIRST");
M | 423 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 418 |  |
    Source: env_remove("RESTRICT_SETUID");
    Source: env_remove("RESTRICT_SETGID");
M | 426 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 424 |  |
    Source: env_remove("RESTRICT_SETGID_PRIV");
    Source: env_remove("RESTRICT_GID_FIRST");
M | 423 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 418 |  |
    Source: env_remove("RESTRICT_SETUID");
    Source: env_remove("RESTRICT_SETGID");
M | 412 | Procedure contains UR data flow anomalies. : set.first_valid_gid | CERT EXP33-C
| 415 |  |
    Source: restrict_access(&set, home, disallow_root);
    Source: struct restrict_access_settings set;
M | 412 | Procedure contains UR data flow anomalies. : set.last_valid_gid | CERT EXP33-C
| 415 |  |
    Source: restrict_access(&set, home, disallow_root);
    Source: struct restrict_access_settings set;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
restrict-access.c | 412 | restrict-access.c | 415 | set.first_valid_gid
    Source: struct restrict_access_settings set;
    Source: restrict_access(&set, home, disallow_root);
restrict-access.c | 412 | restrict-access.c | 415 | set.last_valid_gid
    Source: struct restrict_access_settings set;
    Source: restrict_access(&set, home, disallow_root);

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

restrict_access_use_priv_gid (445 to 457 restrict-access.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 452 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 447 |  |
    Source: i_assert(!process_using_priv_gid);
    Source: i_error("setegid(privileged) failed: %m");
M | 452 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 447 |  |
    Source: i_assert(!process_using_priv_gid);
    Source: i_error("setegid(privileged) failed: %m");

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

restrict_process_size (8 to 40 restrict-process-size.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: i_fatal("setrlimit(RLIMIT_DATA, %u): %m", size);
    Source: i_fatal("setrlimit(RLIMIT_AS, %u): %m", size);
M | 26 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("setrlimit(RLIMIT_NPROC, %u): %m", size);
    Source: i_fatal("setrlimit(RLIMIT_DATA, %u): %m", size);
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: i_fatal("setrlimit(RLIMIT_DATA, %u): %m", size);
    Source: i_fatal("setrlimit(RLIMIT_AS, %u): %m", size);
M | 26 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: i_fatal("setrlimit(RLIMIT_NPROC, %u): %m", size);
    Source: i_fatal("setrlimit(RLIMIT_DATA, %u): %m", size);

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

safe_mkdir (10 to 78 safe-mkdir.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_fatal("safe_mkdir() failed: %s (%s, %s) "
    Source: "is still not owned by %s.%s",
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: i_fatal("safe_mkdir() failed: %s (%s, %s) "
    Source: "is still not owned by %s.%s",
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: "is still not owned by %s.%s",
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: "is still not owned by %s.%s",
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
M | 74 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
    Source: dec2str(uid), dec2str(gid));
M | 74 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: dir, dec2str(st.st_uid), dec2str(st.st_gid),
    Source: dec2str(uid), dec2str(gid));
M | 35 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: i_fatal("open() failed for %s: %m", dir);
    Source: i_fatal("fstat() failed for %s: %m", dir);
M | 60 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: i_fatal("close() failed for %s: %m", dir);
    Source: i_fatal("lstat() check failed for %s: %m", dir);
M | 66 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_fatal("Not a directory %s", dir);
    Source: i_fatal("safe_mkdir() failed: %s (%o) is still not mode %o",
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: i_fatal("lstat() failed for %s: %m", dir);
    Source: i_fatal("Can't create directory %s: %m", dir);
M | 38 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 35 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: i_fatal("fstat() failed for %s: %m", dir);
    Source: i_fatal("Not a directory %s", dir);
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("chmod() failed for %s: %m", dir);
    Source: i_fatal("close() failed for %s: %m", dir);
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: i_fatal("lstat() check failed for %s: %m", dir);
    Source: i_fatal("Not a directory %s", dir);
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: i_fatal("Can't create directory %s: %m", dir);
    Source: i_fatal("open() failed for %s: %m", dir);
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: i_fatal("safe_mkdir() failed: %s (%o) is still not mode %o",
    Source: i_fatal("safe_mkdir() failed: %s (%s, %s) "
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: i_fatal("Not a directory %s", dir);
    Source: i_fatal("fchown() failed for %s: %m", dir);
M | 35 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: i_fatal("open() failed for %s: %m", dir);
    Source: i_fatal("fstat() failed for %s: %m", dir);
M | 60 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: i_fatal("close() failed for %s: %m", dir);
    Source: i_fatal("lstat() check failed for %s: %m", dir);
M | 66 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: i_fatal("Not a directory %s", dir);
    Source: i_fatal("safe_mkdir() failed: %s (%o) is still not mode %o",
M | 21 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: i_fatal("lstat() failed for %s: %m", dir);
    Source: i_fatal("Can't create directory %s: %m", dir);
M | 38 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_fatal("fstat() failed for %s: %m", dir);
    Source: i_fatal("Not a directory %s", dir);
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_fatal("chmod() failed for %s: %m", dir);
    Source: i_fatal("close() failed for %s: %m", dir);
M | 63 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: i_fatal("lstat() check failed for %s: %m", dir);
    Source: i_fatal("Not a directory %s", dir);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: i_fatal("Can't create directory %s: %m", dir);
    Source: i_fatal("open() failed for %s: %m", dir);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: i_fatal("safe_mkdir() failed: %s (%o) is still not mode %o",
    Source: i_fatal("safe_mkdir() failed: %s (%s, %s) "
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: i_fatal("Not a directory %s", dir);
    Source: i_fatal("fchown() failed for %s: %m", dir);

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

safe_mkstemp_full (15 to 71 safe-mkstemp.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: str_truncate(prefix, prefix_len);
    Source: str_append(prefix,
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: str_truncate(prefix, prefix_len);
    Source: str_append(prefix,
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: str_append(prefix,
    Source: } while (lstat(str_c(prefix), &st) == 0);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 30 |  |
    Source: str_append(prefix,
    Source: } while (lstat(str_c(prefix), &st) == 0);
M | 36 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_error("stat(%s) failed: %m", str_c(prefix));
    Source: str_truncate(prefix, prefix_len);
M | 36 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 35 |  |
    Source: i_error("stat(%s) failed: %m", str_c(prefix));
    Source: str_truncate(prefix, prefix_len);
M | 58 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
M | 58 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: } while (lstat(str_c(prefix), &st) == 0);
    Source: str_truncate(prefix, prefix_len);
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: i_error("open(%s) failed: %m", str_c(prefix));
    Source: str_truncate(prefix, prefix_len);
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: (void)unlink(str_c(prefix));
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: } while (lstat(str_c(prefix), &st) == 0);
    Source: fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666);
M | 61 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 41 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666);
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: } while (lstat(str_c(prefix), &st) == 0);
    Source: str_truncate(prefix, prefix_len);
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: i_error("open(%s) failed: %m", str_c(prefix));
    Source: str_truncate(prefix, prefix_len);
M | 67 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: i_error("%s", eperm_error_get_chgrp("fchown",
    Source: (void)unlink(str_c(prefix));
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: } while (lstat(str_c(prefix), &st) == 0);
    Source: fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666);
M | 61 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666);
    Source: i_error("fchown(%s, %ld, %ld) failed: %m",
M | 21 | Procedure contains UR data flow anomalies. : randbuf | CERT EXP33-C
| 28 |  |
    Source: random_fill_weak(randbuf, sizeof(randbuf));
    Source: unsigned char randbuf[8];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
safe-mkstemp.c | 21 | safe-mkstemp.c | 28 | randbuf
    Source: unsigned char randbuf[8];
    Source: random_fill_weak(randbuf, sizeof(randbuf));

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

safe_mkstemp (73 to 76 safe-mkstemp.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 75 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return safe_mkstemp_full(prefix, mode, uid, gid, NULL);

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

safe_mkstemp_hostpid (84 to 88 safe-mkstemp.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 87 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_printfa(prefix, "%s.%s.", my_hostname, my_pid);
    Source: return safe_mkstemp(prefix, mode, uid, gid);
M | 87 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_printfa(prefix, "%s.%s.", my_hostname, my_pid);
    Source: return safe_mkstemp(prefix, mode, uid, gid);

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

safe_mkstemp_hostpid_group (90 to 95 safe-mkstemp.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 94 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: str_printfa(prefix, "%s.%s.", my_hostname, my_pid);
    Source: return safe_mkstemp_group(prefix, mode, gid, gid_origin);
M | 94 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: str_printfa(prefix, "%s.%s.", my_hostname, my_pid);
    Source: return safe_mkstemp_group(prefix, mode, gid, gid_origin);

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

seq_range_array_add (36 to 101 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: i_array_init(array, init_count);
    Source: i_array_init(array, init_count);
M | 95 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 90 |  |
    Source: i_assert(idx+1 < count); /* already handled above */
    Source: array_delete(array, idx, 1);
M | 80 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: i_assert(idx < count && data[idx].seq1 >= seq);
    Source: i_assert(data[idx].seq1 > seq || data[idx].seq2 < seq);
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_assert(data[idx].seq1 > seq || data[idx].seq2 < seq);
    Source: array_insert(array, idx, &value, 1);
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: i_array_init(array, init_count);
    Source: array_append(array, &value, 1);
M | 95 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 90 |  |
    Source: i_assert(idx+1 < count); /* already handled above */
    Source: array_delete(array, idx, 1);
M | 80 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: i_assert(idx < count && data[idx].seq1 >= seq);
    Source: i_assert(data[idx].seq1 > seq || data[idx].seq2 < seq);
M | 98 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: i_assert(data[idx].seq1 > seq || data[idx].seq2 < seq);
    Source: array_insert(array, idx, &value, 1);

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

seq_range_array_add_range (103 to 140 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 137 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: i_assert(idx1 < count);
    Source: array_delete(array, idx1 + 1, idx2 - idx1);
M | 137 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: i_assert(idx1 < count);
    Source: array_delete(array, idx1 + 1, idx2 - idx1);

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

seq_range_array_remove_range (228 to 265 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 245 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 239 |  |
    Source: if (seq_range_array_remove(array, seq1))
    Source: if (seq_range_array_remove(array, seq2--))
M | 263 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 257 |  |
    Source: i_assert(data[idx].seq1 >= seq1);
    Source: array_delete(array, idx, idx2-idx);
M | 257 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 245 |  |
    Source: if (seq_range_array_remove(array, seq2--))
    Source: i_assert(data[idx].seq1 >= seq1);
M | 245 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 239 |  |
    Source: if (seq_range_array_remove(array, seq1))
    Source: if (seq_range_array_remove(array, seq2--))
M | 263 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 257 |  |
    Source: i_assert(data[idx].seq1 >= seq1);
    Source: array_delete(array, idx, idx2-idx);
M | 257 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 245 |  |
    Source: if (seq_range_array_remove(array, seq2--))
    Source: i_assert(data[idx].seq1 >= seq1);

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

seq_range_array_intersect (280 to 301 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 297 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 291 |  |
    Source: ret += seq_range_array_remove_range(dest, last_seq + 1,
    Source: ret += seq_range_array_remove_range(dest, last_seq + 1,
M | 297 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 291 |  |
    Source: ret += seq_range_array_remove_range(dest, last_seq + 1,
    Source: ret += seq_range_array_remove_range(dest, last_seq + 1,

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

seq_range_array_have_common (310 to 329 seq-range-array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 314 | Procedure contains UR data flow anomalies. : count1 | CERT EXP33-C
| 318 |  |
    Source: for (i1 = i2 = 0; i1 < count1 && i2 < count2; ) {
    Source: unsigned int i1, i2, count1, count2;
M | 314 | Procedure contains UR data flow anomalies. : count2 | CERT EXP33-C
| 318 |  |
    Source: for (i1 = i2 = 0; i1 < count1 && i2 < count2; ) {
    Source: unsigned int i1, i2, count1, count2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
seq-range-array.c | 314 | seq-range-array.c | 318 | count1
    Source: unsigned int i1, i2, count1, count2;
    Source: for (i1 = i2 = 0; i1 < count1 && i2 < count2; ) {
seq-range-array.c | 314 | seq-range-array.c | 318 | count2
    Source: unsigned int i1, i2, count1, count2;
    Source: for (i1 = i2 = 0; i1 < count1 && i2 < count2; ) {

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

seq_range_array_invert (341 to 389 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 357 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 357 |  |
    Source: i_array_init(array, 4);
    Source: i_array_init(array, 4);
M | 373 | Pointer not checked for null before use : range | CERT EXP08-C,EXP34-C
| 376 |  |
    Source: range = array_get_modifiable(array, &count);
    Source: next_min_seq = range[i].seq2 + 1;
M | 364 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 363 |  |
    Source: i_assert(range[0].seq1 >= min_seq);
    Source: i_assert(range[count-1].seq2 <= max_seq);
M | 368 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: i_assert(range[count-1].seq2 <= max_seq);
    Source: array_clear(array);
M | 387 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 375 |  |
    Source: array_delete(array, i, 1);
    Source: array_append(array, &value, 1);
M | 360 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 357 |  |
    Source: i_array_init(array, 4);
    Source: array_append(array, &value, 1);
M | 364 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 363 |  |
    Source: i_assert(range[0].seq1 >= min_seq);
    Source: i_assert(range[count-1].seq2 <= max_seq);
M | 368 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 364 |  |
    Source: i_assert(range[count-1].seq2 <= max_seq);
    Source: array_clear(array);
M | 387 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 375 |  |
    Source: array_delete(array, i, 1);
    Source: array_append(array, &value, 1);

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

seq_range_array_iter_init (391 to 396 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 395 | Pointer not checked for null before use : iter_r | CERT EXP08-C,EXP34-C
| 394 |  |
    Source: memset(iter_r, 0, sizeof(*iter_r));
    Source: iter_r->array = array;

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

seq_range_array_iter_nth (398 to 423 seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 412 | Pointer not checked for null before use : range | CERT EXP08-C,EXP34-C
| 410 |  |
    Source: range = array_get(iter->array, &count);
    Source: diff = range[i].seq2 - range[i].seq1;

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

sha1_init (160 to 169 sha1.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 164 | Pointer not checked for null before use : ctxt | CERT EXP08-C,EXP34-C
| 163 |  |
    Source: memset(ctxt, 0, sizeof(struct sha1_ctxt));
    Source: H(0) = 0x67452301;

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

sha1_result_libmysqlclient_craps_all_over (231 to 253 sha1.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 245 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
M | 245 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
M | 246 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
M | 246 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
M | 247 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
M | 247 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
M | 248 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
M | 248 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
M | 249 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
M | 249 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
M | 250 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];
M | 250 | Array Bound exceeded. | CERT ARR30-C
    Source: digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];

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

sha1_get_digest (255 to 263 sha1.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 258 | Procedure contains UR data flow anomalies. : ctx.c.b64 | CERT EXP33-C
| 261 |  |
    Source: sha1_loop(&ctx, data, size);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.c.b8 | CERT EXP33-C
| 261 |  |
    Source: sha1_loop(&ctx, data, size);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.count | CERT EXP33-C
| 261 |  |
    Source: sha1_loop(&ctx, data, size);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.h.b32 | CERT EXP33-C
| 260 |  |
    Source: sha1_init(&ctx);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.h.b8 | CERT EXP33-C
| 260 |  |
    Source: sha1_init(&ctx);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.m.b32 | CERT EXP33-C
| 261 |  |
    Source: sha1_loop(&ctx, data, size);
    Source: struct sha1_ctxt ctx;
M | 258 | Procedure contains UR data flow anomalies. : ctx.m.b8 | CERT EXP33-C
| 262 |  |
    Source: sha1_result(&ctx, result);
    Source: struct sha1_ctxt ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
sha1.c | 258 | sha1.c | 261 | ctx.c.b64
    Source: struct sha1_ctxt ctx;
    Source: sha1_loop(&ctx, data, size);
sha1.c | 258 | sha1.c | 262 | ctx.c.b64
    Source: struct sha1_ctxt ctx;
    Source: sha1_result(&ctx, result);
sha1.c | 258 | sha1.c | 261 | ctx.c.b8
    Source: struct sha1_ctxt ctx;
    Source: sha1_loop(&ctx, data, size);
sha1.c | 258 | sha1.c | 262 | ctx.c.b8
    Source: struct sha1_ctxt ctx;
    Source: sha1_result(&ctx, result);
sha1.c | 258 | sha1.c | 261 | ctx.count
    Source: struct sha1_ctxt ctx;
    Source: sha1_loop(&ctx, data, size);
sha1.c | 258 | sha1.c | 262 | ctx.count
    Source: struct sha1_ctxt ctx;
    Source: sha1_result(&ctx, result);
sha1.c | 258 | sha1.c | 260 | ctx.h.b32
    Source: struct sha1_ctxt ctx;
    Source: sha1_init(&ctx);
sha1.c | 258 | sha1.c | 260 | ctx.h.b8
    Source: struct sha1_ctxt ctx;
    Source: sha1_init(&ctx);
sha1.c | 258 | sha1.c | 261 | ctx.m.b32
    Source: struct sha1_ctxt ctx;
    Source: sha1_loop(&ctx, data, size);
sha1.c | 258 | sha1.c | 262 | ctx.m.b32
    Source: struct sha1_ctxt ctx;
    Source: sha1_result(&ctx, result);
sha1.c | 258 | sha1.c | 262 | ctx.m.b8
    Source: struct sha1_ctxt ctx;
    Source: sha1_result(&ctx, result);

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

sha256_transf (178 to 221 sha2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 192 | Pointer not checked for null before use : sub_block | CERT EXP08-C,EXP34-C
| 189 |  |
    Source: sub_block = data + (i << 6);
    Source: PACK32(&sub_block[j << 2], &w[j]);

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

sha256_loop (235 to 265 sha2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 258 | Pointer not checked for null before use : ctx.h | CERT EXP08-C,EXP34-C
| 257 |  |
    Source: sha256_transf(ctx, ctx->block, 1);
    Source: sha256_transf(ctx, shifted_message, block_nb);
M | 258 | Pointer not checked for null before use : shifted_message | CERT EXP08-C,EXP34-C
| 255 |  |
    Source: shifted_message = CONST_PTR_OFFSET(data, rem_len);
    Source: sha256_transf(ctx, shifted_message, block_nb);
M | 261 | Pointer not checked for null before use : shifted_message | CERT EXP08-C,EXP34-C
| 255 |  |
    Source: shifted_message = CONST_PTR_OFFSET(data, rem_len);
    Source: memcpy(ctx->block, &shifted_message[block_nb << 6], rem_len);

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

sha256_get_digest (292 to 300 sha2.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 295 | Procedure contains UR data flow anomalies. : ctx.block | CERT EXP33-C
| 298 |  |
    Source: sha256_loop(&ctx, data, size);
    Source: struct sha256_ctx ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
sha2.c | 295 | sha2.c | 298 | ctx.block
    Source: struct sha256_ctx ctx;
    Source: sha256_loop(&ctx, data, size);

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

sha512_transf (304 to 346 sha2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 317 | Pointer not checked for null before use : sub_block | CERT EXP08-C,EXP34-C
| 314 |  |
    Source: sub_block = data + (i << 7);
    Source: PACK64(&sub_block[j << 3], &w[j]);

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

sha512_loop (360 to 390 sha2.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 383 | Pointer not checked for null before use : ctx.h | CERT EXP08-C,EXP34-C
| 382 |  |
    Source: sha512_transf(ctx, ctx->block, 1);
    Source: sha512_transf(ctx, shifted_message, block_nb);
M | 383 | Pointer not checked for null before use : shifted_message | CERT EXP08-C,EXP34-C
| 380 |  |
    Source: shifted_message = CONST_PTR_OFFSET(data, rem_len);
    Source: sha512_transf(ctx, shifted_message, block_nb);
M | 386 | Pointer not checked for null before use : shifted_message | CERT EXP08-C,EXP34-C
| 380 |  |
    Source: shifted_message = CONST_PTR_OFFSET(data, rem_len);
    Source: memcpy(ctx->block, &shifted_message[block_nb << 7], rem_len);

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

sha512_get_digest (417 to 425 sha2.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 420 | Procedure contains UR data flow anomalies. : ctx.block | CERT EXP33-C
| 423 |  |
    Source: sha512_loop(&ctx, data, size);
    Source: struct sha512_ctx ctx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
sha2.c | 420 | sha2.c | 423 | ctx.block
    Source: struct sha512_ctx ctx;
    Source: sha512_loop(&ctx, data, size);

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

init_suffixes (33 to 52 str-find.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 42 | Pointer not checked for null before use : suffixes | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: suffixes[len_1] = ctx->key_len;
    Source: suffixes[i] = suffixes[i + len_1 - f];

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

str_find_init (79 to 97 str-find.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 86 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: ctx = p_malloc(pool, sizeof(struct str_find_context) +
M | 86 | Insufficient space allocated. | CERT MEM35-C
    Source: ctx = p_malloc(pool, sizeof(struct str_find_context) +
M | 96 | Local structure returned in function result : ctx |
    Source: return ctx;
M | 88 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: ctx = p_malloc(pool, sizeof(struct str_find_context) +
    Source: ctx->pool = pool;
M | 94 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_assert(key_len > 0);
    Source: init_goodtab(ctx);
M | 94 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 84 |  |
    Source: i_assert(key_len > 0);
    Source: init_goodtab(ctx);

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

str_find_deinit (99 to 107 str-find.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 105 | Pointer not checked for null before use : (ctx)->pool | CERT EXP08-C,EXP34-C
| 104 |  |
    Source: p_free(ctx->pool, ctx->matches);
    Source: p_free(ctx->pool, ctx->key);
M | 105 | Attempt to read from freed memory. : *((ctx)->pool) | CERT MEM30-C
    Source: p_free(ctx->pool, ctx->key);
M | 106 | Pointer not checked for null before use : (ctx)->pool | CERT EXP08-C,EXP34-C
| 105 |  |
    Source: p_free(ctx->pool, ctx->key);
    Source: p_free(ctx->pool, ctx);
M | 106 | Attempt to read from freed memory. : *((ctx)->pool) | CERT MEM30-C
    Source: p_free(ctx->pool, ctx);
M | 104 | Pointer not checked for null before use : *((ctx)->pool) | CERT EXP08-C,EXP34-C
| Ref. Line 0 (Module 713) |  |
    Ref(0):Line 0 in C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STR-FIND_713.ref
    Source: p_free(ctx->pool, ctx->matches);
M | 105 | Pointer not checked for null before use : *((ctx)->pool) | CERT EXP08-C,EXP34-C
| Ref. Line 0 (Module 713) |  |
    Ref(0):Line 0 in C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STR-FIND_713.ref
    Source: p_free(ctx->pool, ctx->key);
M | 106 | Pointer not checked for null before use : *((ctx)->pool) | CERT EXP08-C,EXP34-C
| Ref. Line 0 (Module 713) |  |
    Ref(0):Line 0 in C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STR-FIND_713.ref
    Source: p_free(ctx->pool, ctx);

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

str_sanitize_append (25 to 56 str-sanitize.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 54 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: str_truncate(dest, str_len(dest) <= 3 ? 0 : str_len(dest)-3);
    Source: str_append(dest, "...");
M | 54 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: str_truncate(dest, str_len(dest) <= 3 ? 0 : str_len(dest)-3);
    Source: str_append(dest, "...");
M | 37 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: ret = uni_utf8_get_char(src+i, &chr);
    Source: str_append_c(dest, '?');
M | 48 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: ret = uni_utf8_get_char(src+i, &chr);
    Source: str_append_c(dest, src[i]);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: str_append_c(dest, '?');
    Source: ret = uni_utf8_get_char(src+i, &chr);
M | 37 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: ret = uni_utf8_get_char(src+i, &chr);
    Source: str_append_c(dest, '?');
M | 48 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: ret = uni_utf8_get_char(src+i, &chr);
    Source: str_append_c(dest, src[i]);
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: str_append_c(dest, '?');
    Source: ret = uni_utf8_get_char(src+i, &chr);

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

str_sanitize (58 to 74 str-sanitize.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: str_append_n(str, src, i);
    Source: str_sanitize_append(str, src + i, max_len - i);
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: str_append_n(str, src, i);
    Source: str_sanitize_append(str, src + i, max_len - i);
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: str_sanitize_append(str, src + i, max_len - i);
    Source: return str_c(str);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: str_sanitize_append(str, src + i, max_len - i);
    Source: return str_c(str);
M | 71 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: str = t_str_new(I_MIN(max_len, 256));
    Source: str_append_n(str, src, i);
M | 70 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: i = str_sanitize_skip_start(src, max_len);
    Source: str = t_str_new(I_MIN(max_len, 256));
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: str = t_str_new(I_MIN(max_len, 256));
    Source: str_append_n(str, src, i);
M | 70 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: i = str_sanitize_skip_start(src, max_len);
    Source: str = t_str_new(I_MIN(max_len, 256));
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: str = t_str_new(I_MIN(max_len, 256));
    Source: str_append_n(str, src, i);

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

str_new_const (15 to 25 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 22 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: ret = p_new(pool, buffer_t, 1);
    Source: buffer_create_const_data(ret, str, len + 1);
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: buffer_create_const_data(ret, str, len + 1);
    Source: str_truncate(ret, len);
M | 23 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: buffer_create_const_data(ret, str, len + 1);
    Source: str_truncate(ret, len);
M | 22 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: i_assert(str[len] == '\0');
    Source: buffer_create_const_data(ret, str, len + 1);
M | 22 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: i_assert(str[len] == '\0');
    Source: buffer_create_const_data(ret, str, len + 1);

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

t_str_new (27 to 30 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: return str_new(pool_datastack_create(), initial_size);
    Source: return str_new(pool_datastack_create(), initial_size);
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: return str_new(pool_datastack_create(), initial_size);
    Source: return str_new(pool_datastack_create(), initial_size);

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

t_str_new_const (32 to 35 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: return str_new_const(pool_datastack_create(), str, len);
    Source: return str_new_const(pool_datastack_create(), str, len);
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: return str_new_const(pool_datastack_create(), str, len);
    Source: return str_new_const(pool_datastack_create(), str, len);

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

str_add_nul (42 to 53 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 51 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: buffer_write(str, len, "", 1);
    Source: buffer_set_used_size(str, len);
M | 51 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: buffer_write(str, len, "", 1);
    Source: buffer_set_used_size(str, len);

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

str_c (61 to 65 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 64 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return buffer_get_data(str, NULL);

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

str_data (67 to 70 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 69 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return buffer_get_data(str, NULL);

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

str_c_modifiable (72 to 76 str.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 75 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: return buffer_get_modifiable_data(str, NULL);

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

str_append_str (112 to 119 str.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 118 | Pointer not checked for null before use : cstr | CERT EXP08-C,EXP34-C
| 117 |  |
    Source: cstr = buffer_get_data(src, &len);
    Source: buffer_append(dest, cstr, len);
M | 115 | Procedure contains UR data flow anomalies. : len | CERT EXP33-C
| 117 |  |
    Source: cstr = buffer_get_data(src, &len);
    Source: size_t len;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
str.c | 115 | str.c | 117 | len
    Source: size_t len;
    Source: cstr = buffer_get_data(src, &len);

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

str_vprintfa (130 to 162 str.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 148 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: fmt = printf_format_fix_get_len(fmt, &init_size);
    Source: tmp = buffer_get_space_unsafe(str, pos, init_size);
M | 148 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: fmt = printf_format_fix_get_len(fmt, &init_size);
    Source: tmp = buffer_get_space_unsafe(str, pos, init_size);
M | 149 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, init_size);
    Source: ret = vsnprintf(tmp, init_size, fmt, args);
M | 149 | Pointer not checked for null before use : fmt | CERT EXP08-C,EXP34-C
| 144 |  |
    Source: fmt = printf_format_fix_get_len(fmt, &init_size);
    Source: ret = vsnprintf(tmp, init_size, fmt, args);
M | 156 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 155 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, ret + 1);
    Source: ret2 = vsnprintf(tmp, ret + 1, fmt, args2);
M | 150 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, init_size);
    Source: i_assert(ret >= 0);
M | 161 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 150 |  |
    Source: i_assert(ret >= 0);
    Source: buffer_set_used_size(str, pos + ret);
M | 157 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 155 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, ret + 1);
    Source: i_assert(ret2 == ret);
M | 150 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, init_size);
    Source: i_assert(ret >= 0);
M | 161 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 150 |  |
    Source: i_assert(ret >= 0);
    Source: buffer_set_used_size(str, pos + ret);
M | 157 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 155 |  |
    Source: tmp = buffer_get_space_unsafe(str, pos, ret + 1);
    Source: i_assert(ret2 == ret);
M | 133 | Procedure contains UR data flow anomalies. : args2 | CERT EXP33-C
| 139 |  |
    Source: VA_COPY(args2, args);
    Source: va_list args2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
str.c | 133 | str.c | 139 | args2
    Source: va_list args2;
    Source: VA_COPY(args2, args);

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

str_escape (7 to 31 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: ret = t_str_new((size_t) (p - str) + 128);
    Source: str_append_n(ret, str, (size_t) (p - str));
M | 23 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: ret = t_str_new((size_t) (p - str) + 128);
    Source: str_append_n(ret, str, (size_t) (p - str));
M | 23 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 22 |  |
    Source: ret = t_str_new((size_t) (p - str) + 128);
    Source: str_append_n(ret, str, (size_t) (p - str));
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_append_c(ret, '\\');
    Source: str_append_c(ret, *p);
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: str_append_n(ret, str, (size_t) (p - str));
    Source: return str_c(ret);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_append_c(ret, '\\');
    Source: str_append_c(ret, *p);
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: str_append_n(ret, str, (size_t) (p - str));
    Source: return str_c(ret);

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

str_append_unescaped (33 to 53 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: str_append_n(dest, src_c + start, i-start);
    Source: str_append_c(dest, src_c[i++]);
M | 44 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: str_append_c(dest, src_c[i++]);
    Source: str_append_n(dest, src_c + start, i-start);
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: str_append_n(dest, src_c + start, i-start);
    Source: str_append_c(dest, src_c[i++]);
M | 44 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: str_append_c(dest, src_c[i++]);
    Source: str_append_n(dest, src_c + start, i-start);

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

str_unescape (55 to 78 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 66 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: *dest++ = *str;
    Source: for (dest = str; *str != '\0'; str++) {
M | 76 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: for (dest = str; *str != '\0'; str++) {
    Source: *dest = '\0';
M | 73 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: for (dest = str; *str != '\0'; str++) {
    Source: *dest++ = *str;

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

str_tabescape_write (80 to 105 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, '1');
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, '1');
M | 90 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 't');
M | 90 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 't');
M | 94 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 'r');
M | 94 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 93 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 'r');
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 'n');
M | 98 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_c(dest, 'n');
M | 101 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_append_c(dest, '1');
    Source: str_append_c(dest, *src);
M | 101 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str_append_c(dest, '1');
    Source: str_append_c(dest, *src);

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

str_tabescape (107 to 121 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 115 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: tmp = t_str_new(128);
    Source: str_append_n(tmp, str, p-str);
M | 115 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: tmp = t_str_new(128);
    Source: str_append_n(tmp, str, p-str);
M | 115 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 114 |  |
    Source: tmp = t_str_new(128);
    Source: str_append_n(tmp, str, p-str);
M | 116 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: str_append_n(tmp, str, p-str);
    Source: str_tabescape_write(tmp, p);
M | 116 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 115 |  |
    Source: str_append_n(tmp, str, p-str);
    Source: str_tabescape_write(tmp, p);
M | 117 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: str_tabescape_write(tmp, p);
    Source: return str_c(tmp);
M | 117 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: str_tabescape_write(tmp, p);
    Source: return str_c(tmp);

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

str_append_tabunescaped (123 to 161 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 153 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 134 |  |
    Source: str_append_n(dest, src_c + start, i-start);
    Source: str_append_c(dest, src_c[i]);
M | 134 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_n(dest, src_c + start, i-start);
M | 153 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 134 |  |
    Source: str_append_n(dest, src_c + start, i-start);
    Source: str_append_c(dest, src_c[i]);
M | 134 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 141 |  |
    Source: str_append_c(dest, '\001');
    Source: str_append_n(dest, src_c + start, i-start);

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

str_tabunescape (163 to 203 strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 174 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 176 |  |
    Source: *dest++ = *str;
    Source: for (dest = str; *str != '\0'; str++) {
M | 201 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 174 |  |
    Source: for (dest = str; *str != '\0'; str++) {
    Source: *dest = '\0';
M | 176 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 174 |  |
    Source: for (dest = str; *str != '\0'; str++) {
    Source: *dest++ = *str;

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

i_snprintf (15 to 29 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 23 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: i_assert(max_chars < INT_MAX);
    Source: ret = vsnprintf(dest, max_chars, printf_format_fix_unsafe(format),
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: ret = vsnprintf(dest, max_chars, printf_format_fix_unsafe(format),
    Source: i_assert(ret >= 0);
M | 23 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: i_assert(max_chars < INT_MAX);
    Source: ret = vsnprintf(dest, max_chars, printf_format_fix_unsafe(format),
M | 27 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: ret = vsnprintf(dest, max_chars, printf_format_fix_unsafe(format),
    Source: i_assert(ret >= 0);

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

p_strdup (31 to 46 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 44 | Insufficient space for operation. | CERT DCL33-C,FIO43-C
    Source: memcpy(mem, str, len);

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

p_strndup (70 to 88 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 85 | Insufficient space for operation. | CERT DCL33-C,FIO43-C
    Source: memcpy(mem, str, len);

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

t_noalloc_strdup_vprintf (102 to 132 strfuncs.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 119 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: format = printf_format_fix_get_len(format, &init_size);
    Source: tmp = t_buffer_get(init_size);
M | 119 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: format = printf_format_fix_get_len(format, &init_size);
    Source: tmp = t_buffer_get(init_size);
M | 120 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 119 |  |
    Source: tmp = t_buffer_get(init_size);
    Source: ret = vsnprintf(tmp, init_size, format, args);
M | 120 | Pointer not checked for null before use : format | CERT EXP08-C,EXP34-C
| 116 |  |
    Source: format = printf_format_fix_get_len(format, &init_size);
    Source: ret = vsnprintf(tmp, init_size, format, args);
M | 128 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 127 |  |
    Source: tmp = t_buffer_get(*size_r);
    Source: ret = vsnprintf(tmp, *size_r, format, args2);
M | 127 | Pointer not checked for null before use : size_r | CERT EXP08-C,EXP34-C
| 123 |  |
    Source: *size_r = ret + 1;
    Source: tmp = t_buffer_get(*size_r);
M | 121 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 119 |  |
    Source: tmp = t_buffer_get(init_size);
    Source: i_assert(ret >= 0);
M | 129 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 127 |  |
    Source: tmp = t_buffer_get(*size_r);
    Source: i_assert((unsigned int)ret == *size_r-1);
M | 127 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: i_assert(ret >= 0);
    Source: tmp = t_buffer_get(*size_r);
M | 121 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 119 |  |
    Source: tmp = t_buffer_get(init_size);
    Source: i_assert(ret >= 0);
M | 129 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 127 |  |
    Source: tmp = t_buffer_get(*size_r);
    Source: i_assert((unsigned int)ret == *size_r-1);
M | 127 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: i_assert(ret >= 0);
    Source: tmp = t_buffer_get(*size_r);
M | 106 | Procedure contains UR data flow anomalies. : args2 | CERT EXP33-C
| 111 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: VA_COPY(args2, args);
    Source: va_list args2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strfuncs.c | 106 | strfuncs.c | 111 | args2
    Source: va_list args2;
    Source: VA_COPY(args2, args);

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

p_strdup_vprintf (134 to 148 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 145 | Pointer not checked for null before use : tmp | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: tmp = t_noalloc_strdup_vprintf(format, args, &size);
    Source: memcpy(buf, tmp, size - 1);
M | 141 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: tmp = t_noalloc_strdup_vprintf(format, args, &size);
    Source: t_buffer_alloc(size);
M | 141 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: tmp = t_noalloc_strdup_vprintf(format, args, &size);
    Source: t_buffer_alloc(size);

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

vstrconcat (150 to 184 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 170 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 169 |  |
    Source: bufsize = nearest_power(i + len + 1);
    Source: temp = t_buffer_reget(temp, bufsize);
M | 170 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 169 |  |
    Source: bufsize = nearest_power(i + len + 1);
    Source: temp = t_buffer_reget(temp, bufsize);
M | 165 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 159 |  |
    Source: str = str1;
    Source: len = strlen(str);
M | 170 | Pointer not checked for null before use : temp | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: temp = t_buffer_get(bufsize);
    Source: temp = t_buffer_reget(temp, bufsize);
M | 169 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: temp = t_buffer_get(bufsize);
    Source: bufsize = nearest_power(i + len + 1);
M | 179 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 170 |  |
    Source: temp = t_buffer_reget(temp, bufsize);
    Source: i_assert(i < bufsize);
M | 169 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 161 |  |
    Source: temp = t_buffer_get(bufsize);
    Source: bufsize = nearest_power(i + len + 1);
M | 179 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 170 |  |
    Source: temp = t_buffer_reget(temp, bufsize);
    Source: i_assert(i < bufsize);

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

p_strconcat (186 to 213 strfuncs.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 200 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: T_BEGIN {
    Source: temp = vstrconcat(str1, args, &len);
M | 200 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 199 |  |
    Source: T_BEGIN {
    Source: temp = vstrconcat(str1, args, &len);
M | 197 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 195 |  |
    Source: ret = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 204 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 200 |  |
    Source: temp = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 208 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 204 |  |
    Source: t_buffer_alloc(len);
    Source: } T_END;
M | 197 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 195 |  |
    Source: ret = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 204 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 200 |  |
    Source: temp = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 208 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 204 |  |
    Source: t_buffer_alloc(len);
    Source: } T_END;
M | 190 | Procedure contains UR data flow anomalies. : len | CERT EXP33-C
| 197 |  |
    Source: t_buffer_alloc(len);
    Source: size_t len;
M | 202 | Procedure contains UR data flow anomalies. : ret | CERT EXP33-C
| 189 |  |
    Source: char *temp, *ret;
    Source: ret = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strfuncs.c | 190 | strfuncs.c | 197 | len
    Source: size_t len;
    Source: t_buffer_alloc(len);
strfuncs.c | 190 | strfuncs.c | 204 | len
    Source: size_t len;
    Source: t_buffer_alloc(len);
strfuncs.c | 202 | strfuncs.c | 212 | ret
    Source: ret = NULL;
    Source: return ret;

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

t_strdup (215 to 218 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 217 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strdup(unsafe_data_stack_pool, str);

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

t_strdup_noconst (220 to 223 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 222 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strdup(unsafe_data_stack_pool, str);

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

t_strdup_empty (225 to 228 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 227 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strdup_empty(unsafe_data_stack_pool, str);

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

t_strdup_until (230 to 233 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 232 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strdup_until(unsafe_data_stack_pool, start, end);

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

t_strndup (235 to 238 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 237 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strndup(unsafe_data_stack_pool, str, max_chars);

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

t_strdup_printf (240 to 250 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 246 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: ret = p_strdup_vprintf(unsafe_data_stack_pool, format, args);

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

t_strdup_vprintf (252 to 255 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 254 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return p_strdup_vprintf(unsafe_data_stack_pool, format, args);

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

t_strconcat (257 to 271 strfuncs.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 267 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 265 |  |
    Source: ret = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 267 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 265 |  |
    Source: ret = vstrconcat(str1, args, &len);
    Source: t_buffer_alloc(len);
M | 261 | Procedure contains UR data flow anomalies. : len | CERT EXP33-C
| 267 |  |
    Source: t_buffer_alloc(len);
    Source: size_t len;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strfuncs.c | 261 | strfuncs.c | 267 | len
    Source: size_t len;
    Source: t_buffer_alloc(len);

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

i_memcasecmp (337 to 352 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 344 | Pointer not checked for null before use : s1 | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: s1++; s2++; size--;
    Source: ret = i_toupper(*s1) - i_toupper(*s2);
M | 344 | Pointer not checked for null before use : s2 | CERT EXP08-C,EXP34-C
| 348 |  |
    Source: s1++; s2++; size--;
    Source: ret = i_toupper(*s1) - i_toupper(*s2);

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

split_str (384 to 440 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 406 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 401 |  |
    Source: str = p_strdup(pool, data);
    Source: array[0] = str; count = 1;
M | 412 | Pointer not checked for null before use : array | CERT EXP08-C,EXP34-C
| 406 |  |
    Source: array[0] = str; count = 1;
    Source: array = p_realloc(pool, array,
M | 407 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 433 |  |
    Source: str++;
    Source: while (*str != '\0') {
M | 436 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 411 |  |
    Source: new_alloc_count = nearest_power(alloc_count+1);
    Source: i_assert(count < alloc_count);
M | 436 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 411 |  |
    Source: new_alloc_count = nearest_power(alloc_count+1);
    Source: i_assert(count < alloc_count);

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

t_strsplit (442 to 446 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 444 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return (const char **)split_str(unsafe_data_stack_pool, data,

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

t_strsplit_spaces (448 to 452 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 450 | Pointer not checked for null before use : unsafe_data_stack_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1036 (Module 717) |  |
    Ref(-1036)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\STRFUNCS_717.ref" looking for line -1036
    Source: return (const char **)split_str(unsafe_data_stack_pool, data,

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

p_strsplit_free (465 to 469 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 468 | free parameter is not heap item. | CERT MEM34-C
    Source: p_free(pool, arr);
M | 468 | Attempt to use already freed object. | CERT MEM31-C
    Source: p_free(pool, arr);
M | 468 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 467 |  |
    Source: p_free(pool, arr[0]);
    Source: p_free(pool, arr);
M | 468 | Pointer not checked for null before use : arr | CERT EXP08-C,EXP34-C
| 467 |  |
    Source: p_free(pool, arr[0]);
    Source: p_free(pool, arr);

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

t_strarray_join (484 to 512 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 498 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 497 |  |
    Source: alloc_len = nearest_power(needed_space);
    Source: str = t_buffer_reget(str, alloc_len);
M | 498 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 497 |  |
    Source: alloc_len = nearest_power(needed_space);
    Source: str = t_buffer_reget(str, alloc_len);
M | 498 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 491 |  |
    Source: str = t_buffer_get(alloc_len);
    Source: str = t_buffer_reget(str, alloc_len);
M | 510 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 491 |  |
    Source: str = t_buffer_get(alloc_len);
    Source: t_buffer_alloc(pos + 1);
M | 510 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 491 |  |
    Source: str = t_buffer_get(alloc_len);
    Source: t_buffer_alloc(pos + 1);

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

str_array_remove (514 to 528 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 521 | Pointer not checked for null before use : arr | CERT EXP08-C,EXP34-C
| 522 |  |
    Source: *dest = *arr;
    Source: for (dest = arr, arr++; *arr != NULL; arr++, dest++)
M | 522 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 521 |  |
    Source: for (dest = arr, arr++; *arr != NULL; arr++, dest++)
    Source: *dest = *arr;

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

p_strarray_dup (548 to 568 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 559 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 558 |  |
    Source: ret = p_malloc(pool, size);
    Source: p = PTR_OFFSET(ret, sizeof(const char *) * (i + 1));
M | 563 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 562 |  |
    Source: memcpy(p, arr[i], len);
    Source: ret[i] = p;

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

dec2str (570 to 586 strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 584 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 576 |  |
    Source: buffer = t_malloc(pos);
    Source: i_assert(pos >= 0);
M | 584 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 576 |  |
    Source: buffer = t_malloc(pos);
    Source: i_assert(pos >= 0);

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

str_to_uint (20 to 31 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 22 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 27 |  |
    Source: if (l > (unsigned int)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 22 | strnum.c | 27 | l
    Source: uintmax_t l;
    Source: if (l > (unsigned int)-1)
strnum.c | 22 | strnum.c | 29 | l
    Source: uintmax_t l;
    Source: *num_r = (unsigned int)l;

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

str_to_ulong (33 to 44 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 35 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 40 |  |
    Source: if (l > (unsigned long)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 35 | strnum.c | 40 | l
    Source: uintmax_t l;
    Source: if (l > (unsigned long)-1)
strnum.c | 35 | strnum.c | 42 | l
    Source: uintmax_t l;
    Source: *num_r = (unsigned long)l;

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

str_to_ullong (46 to 57 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 48 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 53 |  |
    Source: if (l > (unsigned long long)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 48 | strnum.c | 53 | l
    Source: uintmax_t l;
    Source: if (l > (unsigned long long)-1)
strnum.c | 48 | strnum.c | 55 | l
    Source: uintmax_t l;
    Source: *num_r = (unsigned long long)l;

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

str_to_uint32 (59 to 70 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 61 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 66 |  |
    Source: if (l > (uint32_t)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 61 | strnum.c | 66 | l
    Source: uintmax_t l;
    Source: if (l > (uint32_t)-1)
strnum.c | 61 | strnum.c | 68 | l
    Source: uintmax_t l;
    Source: *num_r = (uint32_t)l;

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

str_to_uint64 (72 to 83 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 74 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 79 |  |
    Source: if (l > (uint64_t)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 74 | strnum.c | 79 | l
    Source: uintmax_t l;
    Source: if (l > (uint64_t)-1)
strnum.c | 74 | strnum.c | 81 | l
    Source: uintmax_t l;
    Source: *num_r = (uint64_t)l;

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

str_to_int (106 to 117 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 108 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 113 |  |
    Source: if (l < INT_MIN || l > INT_MAX)
    Source: intmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 108 | strnum.c | 113 | l
    Source: intmax_t l;
    Source: if (l < INT_MIN || l > INT_MAX)
strnum.c | 108 | strnum.c | 115 | l
    Source: intmax_t l;
    Source: *num_r = (int)l;

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

str_to_long (119 to 130 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 121 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 126 |  |
    Source: if (l < LONG_MIN || l > LONG_MAX)
    Source: intmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 121 | strnum.c | 126 | l
    Source: intmax_t l;
    Source: if (l < LONG_MIN || l > LONG_MAX)
strnum.c | 121 | strnum.c | 128 | l
    Source: intmax_t l;
    Source: *num_r = (long)l;

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

str_to_llong (132 to 143 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 134 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 139 |  |
    Source: if (l < LLONG_MIN || l > LLONG_MAX)
    Source: intmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 134 | strnum.c | 139 | l
    Source: intmax_t l;
    Source: if (l < LLONG_MIN || l > LLONG_MAX)
strnum.c | 134 | strnum.c | 141 | l
    Source: intmax_t l;
    Source: *num_r = (long long)l;

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

str_to_intmax (145 to 167 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 148 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 158 |  |
    Source: if (l > INTMAX_MAX)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 148 | strnum.c | 158 | l
    Source: uintmax_t l;
    Source: if (l > INTMAX_MAX)

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

str_to_uid (181 to 192 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 183 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 188 |  |
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 183 | strnum.c | 188 | l
    Source: uintmax_t l;
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)

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

str_to_gid (194 to 208 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 196 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 203 |  |
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 196 | strnum.c | 203 | l
    Source: uintmax_t l;
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)

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

str_to_pid (210 to 221 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 212 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 217 |  |
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 212 | strnum.c | 217 | l
    Source: uintmax_t l;
    Source: if (verify_xid(l, sizeof(*num_r)) < 0)

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

str_to_uoff (223 to 234 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 225 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 230 |  |
    Source: if (l > (uoff_t)-1)
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 225 | strnum.c | 230 | l
    Source: uintmax_t l;
    Source: if (l > (uoff_t)-1)
strnum.c | 225 | strnum.c | 232 | l
    Source: uintmax_t l;
    Source: *num_r = (uoff_t)l;

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

str_uint_equals (236 to 243 strnum.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 238 | Procedure contains UR data flow anomalies. : l | CERT EXP33-C
| 242 |  |
    Source: return l == num;
    Source: uintmax_t l;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
strnum.c | 238 | strnum.c | 242 | l
    Source: uintmax_t l;
    Source: return l == num;

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

aqueue_is_ok (7 to 21 test-aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 17 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 14 |  |
    Source: p = array_idx_i(aqueue->arr, aqueue_idx(aqueue, i));
    Source: if (*p != n)

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

test_aqueue2 (24 to 58 test-aqueue.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: t_array_init(&aqueue_array, initial_size);
    Source: t_array_init(&aqueue_array, initial_size);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: t_array_init(&aqueue_array, initial_size);
    Source: t_array_init(&aqueue_array, initial_size);
M | 33 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: t_array_init(&aqueue_array, initial_size);
    Source: aqueue = aqueue_init(&aqueue_array.arr);
M | 33 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: t_array_init(&aqueue_array, initial_size);
    Source: aqueue = aqueue_init(&aqueue_array.arr);
M | 34 | Pointer not checked for null before use : aqueue | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: aqueue = aqueue_init(&aqueue_array.arr);
    Source: aqueue->head = aqueue->tail = initial_size - 1;
M | 38 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: aqueue_append(aqueue, &aqueue_input[j]);
    Source: return t_strdup_printf("Wrong count after append %u vs %u)",
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: aqueue_append(aqueue, &aqueue_input[j]);
    Source: if (!aqueue_is_ok(aqueue, -1U))
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: aqueue_delete(aqueue, i);
    Source: if (!aqueue_is_ok(aqueue, i))
M | 36 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: aqueue = aqueue_init(&aqueue_array.arr);
    Source: aqueue_append(aqueue, &aqueue_input[j]);
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: if (!aqueue_is_ok(aqueue, i))
    Source: t_array_init(&aqueue_array, initial_size);
M | 38 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: aqueue_append(aqueue, &aqueue_input[j]);
    Source: return t_strdup_printf("Wrong count after append %u vs %u)",
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: aqueue_append(aqueue, &aqueue_input[j]);
    Source: if (!aqueue_is_ok(aqueue, -1U))
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 46 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: aqueue_delete(aqueue, i);
    Source: if (!aqueue_is_ok(aqueue, i))
M | 36 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: aqueue = aqueue_init(&aqueue_array.arr);
    Source: aqueue_append(aqueue, &aqueue_input[j]);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: if (!aqueue_is_ok(aqueue, i))
    Source: t_array_init(&aqueue_array, initial_size);
M | 26 | Procedure contains UR data flow anomalies. : aqueue_array.arr.element_size | CERT EXP33-C
| 33 |  |
    Source: aqueue = aqueue_init(&aqueue_array.arr);
    Source: ARRAY_DEFINE(aqueue_array, unsigned int);
M | 26 | Procedure contains UR data flow anomalies. : aqueue_array.arr.buffer | CERT EXP33-C
| 33 |  |
    Source: aqueue = aqueue_init(&aqueue_array.arr);
    Source: ARRAY_DEFINE(aqueue_array, unsigned int);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-aqueue.c | 26 | test-aqueue.c | 33 | aqueue_array.arr.element_size
    Source: ARRAY_DEFINE(aqueue_array, unsigned int);
    Source: aqueue = aqueue_init(&aqueue_array.arr);
test-aqueue.c | 26 | test-aqueue.c | 33 | aqueue_array.arr.buffer
    Source: ARRAY_DEFINE(aqueue_array, unsigned int);
    Source: aqueue = aqueue_init(&aqueue_array.arr);

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

test_aqueue (60 to 71 test-aqueue.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: T_BEGIN {
    Source: reason = test_aqueue2(i);
M | 67 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: T_BEGIN {
    Source: reason = test_aqueue2(i);
M | 68 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: reason = test_aqueue2(i);
    Source: } T_END;
M | 68 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: reason = test_aqueue2(i);
    Source: } T_END;
M | 70 | Pointer not checked for null before use : reason | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: reason = test_aqueue2(i);
    Source: test_out_reason("aqueue", reason == NULL, reason);
M | 66 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: } T_END;
    Source: T_BEGIN {
M | 66 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: } T_END;
    Source: T_BEGIN {

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

test_array_foreach (10 to 31 test-array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 18 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: t_array_init(&foos, 32);
M | 18 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: t_array_init(&foos, 32);
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: array_append(&foos, &nfoo, 1);
M | 21 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: array_append(&foos, &nfoo, 1);
M | 21 | Pointer not checked for null before use : (arr)->buffer | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: array_append(&foos, &nfoo, 1);
M | 21 | Pointer not checked for null before use : (arr)->element_size | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: t_array_init(&foos, 32);
    Source: array_append(&foos, &nfoo, 1);
M | 12 | Procedure contains UR data flow anomalies. : foos.v | CERT EXP33-C
| 24 |  |
    Source: array_foreach(&foos, foo) {
    Source: ARRAY_DEFINE(foos, struct foo);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-array.c | 12 | test-array.c | 24 | foos.v
    Source: ARRAY_DEFINE(foos, struct foo);
    Source: array_foreach(&foos, foo) {

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

test_array_reverse (33 to 52 test-array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: t_array_init(&intarr, 5);
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: t_array_init(&intarr, 5);
M | 44 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: array_clear(&intarr);
    Source: array_append(&intarr, input, i);
M | 44 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: array_clear(&intarr);
    Source: array_append(&intarr, input, i);
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: array_append(&intarr, input, i);
    Source: array_reverse(&intarr);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: array_append(&intarr, input, i);
    Source: array_reverse(&intarr);
M | 43 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: array_clear(&intarr);
M | 43 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: array_clear(&intarr);
M | 43 | Pointer not checked for null before use : (arr)->buffer | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: array_clear(&intarr);
M | 44 | Pointer not checked for null before use : (arr)->element_size | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: t_array_init(&intarr, 5);
    Source: array_append(&intarr, input, i);
M | 35 | Procedure contains UR data flow anomalies. : intarr.arr.buffer | CERT EXP33-C
| 47 |  |
    Source: output = i == 0 ? NULL : array_idx(&intarr, 0);
    Source: ARRAY_DEFINE(intarr, int);
M | 35 | Procedure contains UR data flow anomalies. : intarr.arr.element_size | CERT EXP33-C
| 47 |  |
    Source: output = i == 0 ? NULL : array_idx(&intarr, 0);
    Source: ARRAY_DEFINE(intarr, int);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-array.c | 35 | test-array.c | 47 | intarr.arr.buffer
    Source: ARRAY_DEFINE(intarr, int);
    Source: output = i == 0 ? NULL : array_idx(&intarr, 0);
test-array.c | 35 | test-array.c | 47 | intarr.arr.element_size
    Source: ARRAY_DEFINE(intarr, int);
    Source: output = i == 0 ? NULL : array_idx(&intarr, 0);

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

test_array (54 to 58 test-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 57 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: test_array_foreach();
    Source: test_array_reverse();
M | 57 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: test_array_foreach();
    Source: test_array_reverse();

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

test_base64_encode (9 to 32 test-base64.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 26 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(input); i++) {
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_truncate(str, 0);
    Source: base64_encode(input[i], strlen(input[i]), str);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_truncate(str, 0);
    Source: base64_encode(input[i], strlen(input[i]), str);
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: base64_encode(input[i], strlen(input[i]), str);
    Source: test_assert(strcmp(output[i], str_c(str)) == 0);
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: base64_encode(input[i], strlen(input[i]), str);
    Source: test_assert(strcmp(output[i], str_c(str)) == 0);
M | 27 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 27 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);

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

test_base64_decode (40 to 78 test-base64.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 65 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(input); i++) {
M | 69 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: str_truncate(str, 0);
    Source: ret = base64_decode(input[i], strlen(input[i]), &src_pos, str);
M | 69 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: str_truncate(str, 0);
    Source: ret = base64_decode(input[i], strlen(input[i]), &src_pos, str);
M | 66 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 69 |  |
    Source: ret = base64_decode(input[i], strlen(input[i]), &src_pos, str);
    Source: test_assert(output[i].ret == ret &&
M | 66 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 69 |  |
    Source: ret = base64_decode(input[i], strlen(input[i]), &src_pos, str);
    Source: test_assert(output[i].ret == ret &&
M | 66 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);

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

test_base64_random (80 to 103 test-base64.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 87 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str = t_str_new(256);
    Source: dest = t_str_new(256);
M | 87 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str = t_str_new(256);
    Source: dest = t_str_new(256);
M | 96 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: str_truncate(str, 0);
    Source: str_truncate(dest, 0);
M | 96 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 95 |  |
    Source: str_truncate(str, 0);
    Source: str_truncate(dest, 0);
M | 97 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: str_truncate(dest, 0);
    Source: base64_encode(buf, max, str);
M | 97 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: str_truncate(dest, 0);
    Source: base64_encode(buf, max, str);
M | 98 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: base64_encode(buf, max, str);
    Source: base64_decode(str_data(str), str_len(str), NULL, dest);
M | 98 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 97 |  |
    Source: base64_encode(buf, max, str);
    Source: base64_decode(str_data(str), str_len(str), NULL, dest);
M | 98 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: base64_decode(str_data(str), str_len(str), NULL, dest);
M | 96 | Pointer not checked for null before use : dest | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: dest = t_str_new(256);
    Source: str_truncate(dest, 0);
M | 95 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 95 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: dest = t_str_new(256);
    Source: str_truncate(str, 0);
M | 95 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: dest = t_str_new(256);
    Source: str_truncate(str, 0);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 83 | Procedure contains UR data flow anomalies. : buf | CERT EXP33-C
| 97 |  |
    Source: base64_encode(buf, max, str);
    Source: char buf[10];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-base64.c | 83 | test-base64.c | 97 | buf
    Source: char buf[10];
    Source: base64_encode(buf, max, str);

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

test_base64 (105 to 110 test-base64.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 108 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: test_base64_encode();
    Source: test_base64_decode();
M | 108 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: test_base64_encode();
    Source: test_base64_decode();
M | 109 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_base64_decode();
    Source: test_base64_random();
M | 109 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_base64_decode();
    Source: test_base64_random();

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

test_bsearch_insert_pos (13 to 48 test-bsearch-insert-pos.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 23 | Procedure contains UR data flow anomalies. : success | CERT EXP33-C
| 45 |  |
    Source: test_out(t_strdup_printf("bsearch_insert_pos(%d,%d)", i, key),
    Source: bool success;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-bsearch-insert-pos.c | 23 | test-bsearch-insert-pos.c | 45 | success
    Source: bool success;
    Source: test_out(t_strdup_printf("bsearch_insert_pos(%d,%d)", i, key),

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

test_buffer (8 to 135 test-buffer.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 19 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 723) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\TEST-BUFFER_723.ref" looking for line -1105
    Source: buf = buffer_create_dynamic(default_pool, 1);
M | 27 | Pointer not checked for null before use : buf | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: buf = buffer_create_dynamic(default_pool, 1);
    Source: if (buf->used == BUF_TEST_SIZE) {
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: buffer_set_used_size(buf, size);
    Source: i_assert(buf->used < BUF_TEST_SIZE);
M | 115 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: i_assert(buf->used < BUF_TEST_SIZE);
    Source: p = buffer_get_space_unsafe(buf, pos, size);
M | 122 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: buffer_append_zero(buf, size);
    Source: i_assert(shadowbuf_size <= BUF_TEST_SIZE);
M | 131 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 122 |  |
    Source: i_assert(shadowbuf_size <= BUF_TEST_SIZE);
    Source: test_out_reason("buffer", FALSE,
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: buffer_set_used_size(buf, size);
    Source: i_assert(buf->used < BUF_TEST_SIZE);
M | 115 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: i_assert(buf->used < BUF_TEST_SIZE);
    Source: p = buffer_get_space_unsafe(buf, pos, size);
M | 122 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: buffer_append_zero(buf, size);
    Source: i_assert(shadowbuf_size <= BUF_TEST_SIZE);
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: buf = buffer_create_dynamic(default_pool, 1);
    Source: buffer_set_used_size(buf, size);
M | 131 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 122 |  |
    Source: i_assert(shadowbuf_size <= BUF_TEST_SIZE);
    Source: test_out_reason("buffer", FALSE,
M | 13 | Procedure contains UR data flow anomalies. : testdata | CERT EXP33-C
| 116 |  |
    Source: memcpy(p, testdata, size);
    Source: unsigned char *p, testdata[BUF_TEST_SIZE], shadowbuf[BUF_TEST_SIZE];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-buffer.c | 13 | test-buffer.c | 116 | testdata
    Source: unsigned char *p, testdata[BUF_TEST_SIZE], shadowbuf[BUF_TEST_SIZE];
    Source: memcpy(p, testdata, size);

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

test_binary_to_hex (8 to 30 test-hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 25 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: str = t_str_new(32);
    Source: str_append_c(str, '<');
M | 25 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: str = t_str_new(32);
    Source: str_append_c(str, '<');
M | 25 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: str = t_str_new(32);
    Source: str_append_c(str, '<');
M | 26 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: str_append_c(str, '<');
    Source: binary_to_hex_append(str, input, sizeof(input));
M | 26 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: str_append_c(str, '<');
    Source: binary_to_hex_append(str, input, sizeof(input));
M | 27 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: binary_to_hex_append(str, input, sizeof(input));
    Source: str_append_c(str, '>');
M | 27 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: binary_to_hex_append(str, input, sizeof(input));
    Source: str_append_c(str, '>');
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_append_c(str, '>');
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: str_append_c(str, '>');
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
    Source: test_assert(strcmp(str_c(str), t_strconcat("<", output_lcase, ">", NULL)) == 0);
M | 20 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: test_assert(strcmp(binary_to_hex(input, sizeof(input)), output_lcase) == 0);
    Source: test_assert(strcmp(binary_to_hex_ucase(input, sizeof(input)), output_ucase) == 0);
M | 24 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 20 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: test_assert(strcmp(binary_to_hex_ucase(input, sizeof(input)), output_ucase) == 0);
    Source: str = t_str_new(32);
M | 20 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: test_assert(strcmp(binary_to_hex(input, sizeof(input)), output_lcase) == 0);
    Source: test_assert(strcmp(binary_to_hex_ucase(input, sizeof(input)), output_ucase) == 0);
M | 24 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: test_assert(strcmp(binary_to_hex_ucase(input, sizeof(input)), output_ucase) == 0);
    Source: str = t_str_new(32);

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

test_hex_to_binary (32 to 55 test-hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 52 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(error_input); i++)
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: buffer_t *buf = buffer_create_dynamic(pool_datastack_create(), 10);
    Source: test_assert(hex_to_binary("", buf) == 0);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: buffer_t *buf = buffer_create_dynamic(pool_datastack_create(), 10);
    Source: test_assert(hex_to_binary("", buf) == 0);
M | 48 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: test_assert(hex_to_binary("", buf) == 0);
    Source: test_assert(hex_to_binary(ok_input, buf) == 0);
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: test_assert(hex_to_binary(ok_input, buf) == 0);
    Source: test_assert(hex_to_binary(error_input[i], buf) == -1);
M | 48 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: test_assert(hex_to_binary("", buf) == 0);
    Source: test_assert(hex_to_binary(ok_input, buf) == 0);
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: test_assert(hex_to_binary(ok_input, buf) == 0);
    Source: test_assert(hex_to_binary(error_input[i], buf) == -1);

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

test_hex_binary (57 to 61 test-hex-binary.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 60 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: test_binary_to_hex();
    Source: test_hex_to_binary();
M | 60 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: test_binary_to_hex();
    Source: test_hex_to_binary();

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

test_istream_concat_one (11 to 46 test-istream-concat.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 24 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 23 |  |
    Source: streams[i] = test_istream_create(input_string);
    Source: test_istream_set_allow_eof(streams[i], TRUE);
M | 29 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: streams[i] = NULL;
    Source: input = i_stream_create_concat(streams);
M | 34 | Pointer not checked for null before use : input | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: input = i_stream_create_concat(streams);
    Source: data = i_stream_get_data(input, &size);
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: input = i_stream_create_concat(streams);
    Source: test_assert(i_stream_read(input) == 1);
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: test_assert(i_stream_read(input) == 1);
    Source: i_stream_unref(&input);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: input = i_stream_create_concat(streams);
    Source: test_assert(i_stream_read(input) == 1);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: test_assert(i_stream_read(input) == 1);
    Source: i_stream_unref(&input);

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

test_istream_concat_random (48 to 90 test-istream-concat.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 65 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: streams[i] = test_istream_create_data(w_data, data_len);
    Source: test_istream_set_allow_eof(streams[i], TRUE);
M | 73 | Pointer not checked for null before use : input | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: input = i_stream_create_concat(streams);
    Source: i_stream_seek(input, rand() % offset);
M | 70 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: streams[i] = NULL;
    Source: input = i_stream_create_concat(streams);
M | 64 | Pointer not checked for null before use : w_data | CERT EXP08-C,EXP34-C
| 61 |  |
    Source: w_data = t_malloc(data_len);
    Source: streams[i] = test_istream_create_data(w_data, data_len);
M | 70 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: i_assert(offset > 0);
    Source: input = i_stream_create_concat(streams);
M | 61 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: streams = t_new(struct istream *, stream_count + 1);
    Source: w_data = t_malloc(data_len);
M | 75 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: input = i_stream_create_concat(streams);
    Source: ssize_t ret = i_stream_read(input);
M | 70 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: i_assert(offset > 0);
    Source: input = i_stream_create_concat(streams);
M | 61 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 58 |  |
    Source: streams = t_new(struct istream *, stream_count + 1);
    Source: w_data = t_malloc(data_len);
M | 75 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: input = i_stream_create_concat(streams);
    Source: ssize_t ret = i_stream_read(input);

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

test_istream_concat (96 to 111 test-istream-concat.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 108 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: for (i = 0; i < 100; i++) T_BEGIN {
    Source: test_istream_concat_random();
M | 108 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: for (i = 0; i < 100; i++) T_BEGIN {
    Source: test_istream_concat_random();
M | 109 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_istream_concat_random();
    Source: } T_END;
M | 109 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_istream_concat_random();
    Source: } T_END;
M | 107 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: } T_END;
    Source: for (i = 0; i < 100; i++) T_BEGIN {
M | 107 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: } T_END;
    Source: for (i = 0; i < 100; i++) T_BEGIN {

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

test_istream_crlf_input (8 to 75 test-istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: istream = i_stream_create_from_data(input, input_len);
    Source: str_truncate(output, 0);
M | 21 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: istream = i_stream_create_from_data(input, input_len);
    Source: str_truncate(output, 0);
M | 47 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: i_stream_unref(&istream);
    Source: i_stream_unref(&crlf_istream);
M | 47 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: i_stream_unref(&istream);
    Source: i_stream_unref(&crlf_istream);
M | 48 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: i_stream_unref(&crlf_istream);
    Source: istream = i_stream_create_from_data(input,
M | 48 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: i_stream_unref(&crlf_istream);
    Source: istream = i_stream_create_from_data(input,
M | 51 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: istream = i_stream_create_from_data(input,
    Source: i_stream_create_lf(istream) :
M | 51 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: istream = i_stream_create_from_data(input,
    Source: i_stream_create_lf(istream) :
M | 52 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_stream_create_lf(istream) :
    Source: i_stream_create_crlf(istream);
M | 52 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: i_stream_create_lf(istream) :
    Source: i_stream_create_crlf(istream);
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: i_stream_unref(&crlf_istream);
    Source: i_stream_unref(&istream);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: i_stream_unref(&crlf_istream);
    Source: i_stream_unref(&istream);
M | 21 | Pointer not checked for null before use : output | CERT EXP08-C,EXP34-C
| 17 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: output = t_str_new(256);
    Source: str_truncate(output, 0);
M | 69 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: data = i_stream_get_data(crlf_istream, &size);
    Source: test_assert(memcmp(data, str_data(output), size) == 0);
M | 56 | Pointer not checked for null before use : crlf_istream | CERT EXP08-C,EXP34-C
| 50 |  |
    Source: crlf_istream = j%2 == 0 ?
    Source: ret1 = i_stream_read(crlf_istream);
M | 47 | Pointer not checked for null before use : crlf_istream | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: crlf_istream = i_stream_create_lf(istream);
    Source: i_stream_unref(&crlf_istream);
M | 24 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: str_truncate(output, 0);
    Source: crlf_istream = i_stream_create_lf(istream);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: str_truncate(output, 0);
    Source: crlf_istream = i_stream_create_crlf(istream);
M | 39 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: str_append_c(output, '\r');
    Source: str_append_c(output, input[i]);
M | 62 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: ret1 = i_stream_read(crlf_istream);
    Source: ret2 = i_stream_read(crlf_istream);
M | 20 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: output = t_str_new(256);
    Source: istream = i_stream_create_from_data(input, input_len);
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: i_stream_create_crlf(istream);
    Source: ret1 = i_stream_read(crlf_istream);
M | 30 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: crlf_istream = i_stream_create_lf(istream);
    Source: str_append_c(output, input[i]);
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: ret2 = i_stream_read(crlf_istream);
    Source: i_stream_unref(&crlf_istream);
M | 24 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: str_truncate(output, 0);
    Source: crlf_istream = i_stream_create_lf(istream);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: str_truncate(output, 0);
    Source: crlf_istream = i_stream_create_crlf(istream);
M | 39 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: str_append_c(output, '\r');
    Source: str_append_c(output, input[i]);
M | 62 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 56 |  |
    Source: ret1 = i_stream_read(crlf_istream);
    Source: ret2 = i_stream_read(crlf_istream);
M | 20 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: output = t_str_new(256);
    Source: istream = i_stream_create_from_data(input, input_len);
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: i_stream_create_crlf(istream);
    Source: ret1 = i_stream_read(crlf_istream);
M | 30 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: crlf_istream = i_stream_create_lf(istream);
    Source: str_append_c(output, input[i]);
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: ret2 = i_stream_read(crlf_istream);
    Source: i_stream_unref(&crlf_istream);
M | 15 | Declaration types do not match across a system. : istream | CERT ARR31-C
    Source: struct istream *istream, *crlf_istream;

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

test_istream_crlf (77 to 92 test-istream-crlf.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 89 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(input); i++)

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

fd_callback (11 to 22 test-istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 16 | Procedure contains UR data flow anomalies. : streams.(real_stream)->iostream | CERT EXP33-C
    Source: fd = open(*path_r, O_RDWR | O_CREAT | O_TRUNC, 0600);

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

test_istream_seekable_one (24 to 64 test-istream-seekable.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 37 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: streams[i] = test_istream_create(input_string);
    Source: streams[i]->seekable = FALSE;
M | 43 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: streams[i] = NULL;
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 43 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 48 | Pointer not checked for null before use : input | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
    Source: data = i_stream_get_data(input, &size);
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: test_assert(i_stream_read(input) == -2);
    Source: test_assert(i_stream_read(input) == 1);
M | 63 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: i_stream_unref(&streams[i]);
    Source: i_stream_unref(&input);
M | 51 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
    Source: test_assert(i_stream_read(input) == -2);
M | 62 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: test_assert(i_stream_read(input) == 1);
    Source: i_stream_unref(&streams[i]);
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 51 |  |
    Source: test_assert(i_stream_read(input) == -2);
    Source: test_assert(i_stream_read(input) == 1);
M | 63 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: i_stream_unref(&streams[i]);
    Source: i_stream_unref(&input);
M | 51 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
    Source: test_assert(i_stream_read(input) == -2);
M | 62 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: test_assert(i_stream_read(input) == 1);
    Source: i_stream_unref(&streams[i]);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-istream-seekable.c | 16 | test-istream-seekable.c | 62 | streams.(real_stream)->iostream
    Source: fd = open(*path_r, O_RDWR | O_CREAT | O_TRUNC, 0600);
    Source: i_stream_unref(&streams[i]);

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

test_istream_seekable_random (66 to 119 test-istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 82 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: streams[i] = test_istream_create_data(w_data, data_len);
    Source: streams[i]->seekable = FALSE;
M | 89 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 89 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 85 |  |
    Source: streams[i] = NULL;
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 81 | Pointer not checked for null before use : w_data | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: w_data = t_malloc(data_len);
    Source: streams[i] = test_istream_create_data(w_data, data_len);
M | 89 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: i_assert(offset > 0);
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 92 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
    Source: while (i_stream_read(input) > 0) {
M | 78 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: streams = t_new(struct istream *, stream_count + 1);
    Source: w_data = t_malloc(data_len);
M | 102 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 92 |  |
    Source: while (i_stream_read(input) > 0) {
    Source: ssize_t ret = i_stream_read(input);
M | 89 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: i_assert(offset > 0);
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
M | 92 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 89 |  |
    Source: input = i_stream_create_seekable(streams, buffer_size, fd_callback, NULL);
    Source: while (i_stream_read(input) > 0) {
M | 78 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 75 |  |
    Source: streams = t_new(struct istream *, stream_count + 1);
    Source: w_data = t_malloc(data_len);
M | 102 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 92 |  |
    Source: while (i_stream_read(input) > 0) {
    Source: ssize_t ret = i_stream_read(input);

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

test_istream_seekable_eof (125 to 154 test-istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 136 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: streams[0] = i_stream_create_from_data(in_str, in_str_len);
    Source: streams[0]->seekable = FALSE;
M | 139 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: streams[0] = i_stream_create_from_data(in_str, in_str_len);
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
M | 139 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 135 |  |
    Source: streams[0] = i_stream_create_from_data(in_str, in_str_len);
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
M | 139 | Pointer not checked for null before use : streams | CERT EXP08-C,EXP34-C
| 137 |  |
    Source: streams[1] = NULL;
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
M | 139 | Pointer not checked for null before use : NULL | CERT EXP08-C,EXP34-C
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
M | 140 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
    Source: i_stream_unref(&streams[0]);
M | 140 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 139 |  |
    Source: input = i_stream_create_seekable(streams, in_str_len, fd_callback, NULL);
    Source: i_stream_unref(&streams[0]);
M | 142 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_stream_unref(&streams[0]);
    Source: test_assert(i_stream_read(input) == (ssize_t)in_str_len);
M | 142 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 140 |  |
    Source: i_stream_unref(&streams[0]);
    Source: test_assert(i_stream_read(input) == (ssize_t)in_str_len);
M | 145 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: data = i_stream_get_data(input, &size);
    Source: test_assert(memcmp(data, in_str, in_str_len) == 0);
M | 150 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 148 |  |
    Source: data = i_stream_get_data(input, &size);
    Source: test_assert(memcmp(data, in_str, in_str_len) == 0);
M | 152 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: test_assert(i_stream_read(input) == -1);
    Source: i_stream_unref(&input);
M | 147 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: test_assert(i_stream_read(input) == (ssize_t)in_str_len);
    Source: test_assert(i_stream_read(input) == -1);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 152 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: test_assert(i_stream_read(input) == -1);
    Source: i_stream_unref(&input);
M | 147 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: test_assert(i_stream_read(input) == (ssize_t)in_str_len);
    Source: test_assert(i_stream_read(input) == -1);

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

test_istream_seekable (156 to 172 test-istream-seekable.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 167 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 166 |  |
    Source: for (i = 0; i < 100; i++) T_BEGIN {
    Source: test_istream_seekable_random();
M | 167 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 166 |  |
    Source: for (i = 0; i < 100; i++) T_BEGIN {
    Source: test_istream_seekable_random();
M | 168 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 167 |  |
    Source: test_istream_seekable_random();
    Source: } T_END;
M | 168 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 167 |  |
    Source: test_istream_seekable_random();
    Source: } T_END;
M | 171 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: } T_END;
    Source: test_istream_seekable_eof();
M | 166 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 162 |  |
    Source: test_istream_seekable_one(i);
    Source: for (i = 0; i < 100; i++) T_BEGIN {
M | 171 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 168 |  |
    Source: } T_END;
    Source: test_istream_seekable_eof();
M | 166 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 162 |  |
    Source: test_istream_seekable_one(i);
    Source: for (i = 0; i < 100; i++) T_BEGIN {

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

test_istream_tee_tailing (14 to 82 test-istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Pointer not checked for null before use : test_input | CERT EXP08-C,EXP34-C
| 20 |  |
    Source: test_input = test_istream_create(str);
    Source: test_istream_set_max_buffer_size(test_input, TEST_BUF_SIZE);
M | 76 | Pointer not checked for null before use : child_input | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: test_assert(i_stream_read(child_input[i]) == -1);
M | 32 | Pointer not checked for null before use : child_input | CERT EXP08-C,EXP34-C
| 26 |  |
    Source: child_input[i] = tee_i_stream_create_child(tee);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 26 | Pointer not checked for null before use : tee | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: tee = tee_i_stream_create(test_input);
    Source: child_input[i] = tee_i_stream_create_child(tee);
M | 42 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == -2);
M | 60 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == -2);
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -1);
    Source: i_stream_unref(&child_input[i]);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == 0);
M | 79 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: i_stream_unref(&test_input);
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 41 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -2);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 59 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -2);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 67 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == 0);
M | 76 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == -1);
M | 42 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 41 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == -2);
M | 60 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == -2);
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -1);
    Source: i_stream_unref(&child_input[i]);
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 1);
    Source: test_assert(i_stream_read(child_input[i]) == 0);
M | 79 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: i_stream_unref(&test_input);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 41 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -2);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 59 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 60 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -2);
    Source: test_assert(i_stream_read(child_input[i]) == 1);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == 0);
M | 76 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: test_assert(i_stream_read(child_input[i]) == 0);
    Source: test_assert(i_stream_read(child_input[i]) == -1);

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

test_istream_tee_blocks (84 to 114 test-istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 91 | Pointer not checked for null before use : test_input | CERT EXP08-C,EXP34-C
| 90 |  |
    Source: test_input = test_istream_create(str);
    Source: test_istream_set_max_buffer_size(test_input, TEST_BUF_SIZE);
M | 108 | Pointer not checked for null before use : child_input | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: test_assert(i_stream_read(child_input[i]) == -1);
M | 102 | Pointer not checked for null before use : child_input | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: child_input[i] = tee_i_stream_create_child(tee);
    Source: test_assert(i_stream_read(child_input[i]) == TEST_BUF_SIZE);
M | 96 | Pointer not checked for null before use : tee | CERT EXP08-C,EXP34-C
| 94 |  |
    Source: tee = tee_i_stream_create(test_input);
    Source: child_input[i] = tee_i_stream_create_child(tee);
M | 109 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -1);
    Source: i_stream_unref(&child_input[i]);
M | 111 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: i_stream_unref(&test_input);
M | 108 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: test_assert(i_stream_read(child_input[i]) == TEST_BUF_SIZE);
    Source: test_assert(i_stream_read(child_input[i]) == -1);
M | 102 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: child_input[i] = tee_i_stream_create_child(tee);
    Source: test_assert(i_stream_read(child_input[i]) == TEST_BUF_SIZE);
M | 109 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 108 |  |
    Source: test_assert(i_stream_read(child_input[i]) == -1);
    Source: i_stream_unref(&child_input[i]);
M | 111 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: i_stream_unref(&child_input[i]);
    Source: i_stream_unref(&test_input);
M | 108 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: test_assert(i_stream_read(child_input[i]) == TEST_BUF_SIZE);
    Source: test_assert(i_stream_read(child_input[i]) == -1);
M | 102 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 96 |  |
    Source: child_input[i] = tee_i_stream_create_child(tee);
    Source: test_assert(i_stream_read(child_input[i]) == TEST_BUF_SIZE);

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

test_istream_tee (116 to 129 test-istream-tee.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 125 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 125 |  |
    Source: test_istream_tee_tailing(str_c(str));
    Source: test_istream_tee_tailing(str_c(str));
M | 125 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 125 |  |
    Source: test_istream_tee_tailing(str_c(str));
    Source: test_istream_tee_tailing(str_c(str));
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 125 |  |
    Source: test_istream_tee_tailing(str_c(str));
    Source: test_istream_tee_blocks(str_c(str));
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 125 |  |
    Source: test_istream_tee_tailing(str_c(str));
    Source: test_istream_tee_blocks(str_c(str));
M | 126 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: test_istream_tee_blocks(str_c(str));
    Source: test_istream_tee_blocks(str_c(str));
M | 126 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 126 |  |
    Source: test_istream_tee_blocks(str_c(str));
    Source: test_istream_tee_blocks(str_c(str));
M | 121 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 729) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\TEST-ISTREAM-TEE_729.ref" looking for line -1105
    Source: str = str_new(default_pool, TEST_STR_LEN);
M | 125 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: str = str_new(default_pool, TEST_STR_LEN);
    Source: test_istream_tee_tailing(str_c(str));
M | 123 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: str = str_new(default_pool, TEST_STR_LEN);
    Source: str_append_c(str, 'a' + i%26);
M | 125 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 123 |  |
    Source: str_append_c(str, 'a' + i%26);
    Source: test_istream_tee_tailing(str_c(str));
M | 125 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 121 |  |
    Source: str = str_new(default_pool, TEST_STR_LEN);
    Source: test_istream_tee_tailing(str_c(str));

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

test_dllist (12 to 57 test-llist.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 17 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: l4 = t_new(struct dllist, 1);
    Source: l3 = t_new(struct dllist, 1);
M | 17 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: l4 = t_new(struct dllist, 1);
    Source: l3 = t_new(struct dllist, 1);
M | 18 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: l2 = t_new(struct dllist, 1);
M | 18 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: l2 = t_new(struct dllist, 1);
M | 19 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: l1 = t_new(struct dllist, 1);
M | 19 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: l1 = t_new(struct dllist, 1);
M | 22 | Pointer not checked for null before use : l4 | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: l4 = t_new(struct dllist, 1);
    Source: DLLIST_PREPEND(&head, l4);
M | 30 | Pointer not checked for null before use : head | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: DLLIST_PREPEND(&head, l2);
    Source: DLLIST_PREPEND(&head, l1);
M | 45 | Pointer not checked for null before use : head | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: DLLIST_REMOVE(&head, l1);
    Source: DLLIST_PREPEND(&head, l1);
M | 25 | Pointer not checked for null before use : l3 | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: DLLIST_PREPEND(&head, l3);
M | 29 | Pointer not checked for null before use : l2 | CERT EXP08-C,EXP34-C
| 18 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: DLLIST_PREPEND(&head, l2);
M | 30 | Pointer not checked for null before use : l1 | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: l1 = t_new(struct dllist, 1);
    Source: DLLIST_PREPEND(&head, l1);

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

test_dllist2 (59 to 120 test-llist.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 64 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: l4 = t_new(struct dllist, 1);
    Source: l3 = t_new(struct dllist, 1);
M | 64 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 63 |  |
    Source: l4 = t_new(struct dllist, 1);
    Source: l3 = t_new(struct dllist, 1);
M | 65 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: l2 = t_new(struct dllist, 1);
M | 65 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: l2 = t_new(struct dllist, 1);
M | 66 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 65 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: l1 = t_new(struct dllist, 1);
M | 66 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 65 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: l1 = t_new(struct dllist, 1);
M | 70 | Pointer not checked for null before use : l3 | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: l3 = t_new(struct dllist, 1);
    Source: DLLIST2_PREPEND(&head, &tail, l3);
M | 108 | Pointer not checked for null before use : head | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: DLLIST2_REMOVE(&head, &tail, l1);
    Source: DLLIST2_PREPEND(&head, &tail, l1);
M | 92 | Pointer not checked for null before use : head | CERT EXP08-C,EXP34-C
| 87 |  |
    Source: DLLIST2_APPEND(&head, &tail, l4);
    Source: DLLIST2_PREPEND(&head, &tail, l1);
M | 82 | Pointer not checked for null before use : head | CERT EXP08-C,EXP34-C
| 78 |  |
    Source: DLLIST2_APPEND(&head, &tail, l3);
    Source: DLLIST2_PREPEND(&head, &tail, l2);
M | 87 | Pointer not checked for null before use : tail | CERT EXP08-C,EXP34-C
| 82 |  |
    Source: DLLIST2_PREPEND(&head, &tail, l2);
    Source: DLLIST2_APPEND(&head, &tail, l4);
M | 78 | Pointer not checked for null before use : tail | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: DLLIST2_REMOVE(&head, &tail, l3);
    Source: DLLIST2_APPEND(&head, &tail, l3);
M | 87 | Pointer not checked for null before use : l4 | CERT EXP08-C,EXP34-C
| 63 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: l4 = t_new(struct dllist, 1);
    Source: DLLIST2_APPEND(&head, &tail, l4);
M | 82 | Pointer not checked for null before use : l2 | CERT EXP08-C,EXP34-C
| 65 |  |
    Source: l2 = t_new(struct dllist, 1);
    Source: DLLIST2_PREPEND(&head, &tail, l2);
M | 92 | Pointer not checked for null before use : l1 | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: l1 = t_new(struct dllist, 1);
    Source: DLLIST2_PREPEND(&head, &tail, l1);

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

test_llist (122 to 126 test-llist.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 125 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: test_dllist();
    Source: test_dllist2();
M | 125 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 124 |  |
    Source: test_dllist();
    Source: test_dllist2();

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

test_mempool_alloconly (17 to 46 test-mempool-alloconly.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 28 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 27 |  |
    Source: pool = pool_alloconly_create(MEMPOOL_GROWING"test", i);
    Source: mem[0] = p_malloc(pool, j);
M | 36 | Pointer not checked for null before use : mem | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: memset(mem[k], k, k);
    Source: if (!mem_has_bytes(mem[0], j, j))

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

test_net_is_in_network (13 to 48 test-network.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 43 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: net_addr2ip(input[i].ip, &ip);
    Source: net_addr2ip(input[i].net, &net_ip);
M | 43 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: net_addr2ip(input[i].ip, &ip);
    Source: net_addr2ip(input[i].net, &net_ip);
M | 44 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: net_addr2ip(input[i].net, &net_ip);
    Source: success = net_is_in_network(&ip, &net_ip, input[i].bits) ==
M | 44 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 43 |  |
    Source: net_addr2ip(input[i].net, &net_ip);
    Source: success = net_is_in_network(&ip, &net_ip, input[i].bits) ==
M | 46 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: success = net_is_in_network(&ip, &net_ip, input[i].bits) ==
    Source: test_out(t_strdup_printf("net_is_in_network(%u)", i), success);
M | 46 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 44 |  |
    Source: success = net_is_in_network(&ip, &net_ip, input[i].bits) ==
    Source: test_out(t_strdup_printf("net_is_in_network(%u)", i), success);
M | 42 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: test_out(t_strdup_printf("net_is_in_network(%u)", i), success);
    Source: net_addr2ip(input[i].ip, &ip);
M | 42 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: test_out(t_strdup_printf("net_is_in_network(%u)", i), success);
    Source: net_addr2ip(input[i].ip, &ip);
M | 37 | Procedure contains UR data flow anomalies. : ip.family | CERT EXP33-C
| 42 |  |
    Source: net_addr2ip(input[i].ip, &ip);
    Source: struct ip_addr ip, net_ip;
M | 37 | Procedure contains UR data flow anomalies. : ip.u.ip4 | CERT EXP33-C
| 42 |  |
    Source: net_addr2ip(input[i].ip, &ip);
    Source: struct ip_addr ip, net_ip;
M | 37 | Procedure contains UR data flow anomalies. : ip.u.ip6 | CERT EXP33-C
| 42 |  |
    Source: net_addr2ip(input[i].ip, &ip);
    Source: struct ip_addr ip, net_ip;
M | 37 | Procedure contains UR data flow anomalies. : net_ip.family | CERT EXP33-C
| 43 |  |
    Source: net_addr2ip(input[i].net, &net_ip);
    Source: struct ip_addr ip, net_ip;
M | 37 | Procedure contains UR data flow anomalies. : net_ip.u.ip4 | CERT EXP33-C
| 43 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: net_addr2ip(input[i].net, &net_ip);
    Source: struct ip_addr ip, net_ip;
M | 37 | Procedure contains UR data flow anomalies. : net_ip.u.ip6 | CERT EXP33-C
| 43 |  |
    Source: net_addr2ip(input[i].net, &net_ip);
    Source: struct ip_addr ip, net_ip;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-network.c | 37 | test-network.c | 42 | ip.family
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].ip, &ip);
test-network.c | 37 | test-network.c | 42 | ip.u.ip4
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].ip, &ip);
test-network.c | 37 | test-network.c | 42 | ip.u.ip6
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].ip, &ip);
test-network.c | 37 | test-network.c | 43 | net_ip.family
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].net, &net_ip);
test-network.c | 37 | test-network.c | 43 | net_ip.u.ip4
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].net, &net_ip);
test-network.c | 37 | test-network.c | 43 | net_ip.u.ip6
    Source: struct ip_addr ip, net_ip;
    Source: net_addr2ip(input[i].net, &net_ip);

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

test_priorityq (20 to 104 test-priorityq.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 49 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: item = p_new(pool, struct pq_test_item, 1);
    Source: item->num = input[i];
M | 55 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 54 |  |
    Source: item = (struct pq_test_item *)all_items[0];
    Source: test_assert(item->num == output[0]);
M | 58 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 57 |  |
    Source: item = (struct pq_test_item *)all_items[j];
    Source: test_assert(item->num > output[0]);
M | 65 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: item = (struct pq_test_item *)priorityq_peek(pq);
    Source: test_assert(output[j] == item->num);
M | 67 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
    Source: test_assert(output[j] == item->num);
M | 93 | Pointer not checked for null before use : item | CERT EXP08-C,EXP34-C
| 92 |  |
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
    Source: test_assert(item->num >= 0 && prev <= item->num);
M | 54 | Pointer not checked for null before use : all_items | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: all_items = priorityq_items(pq);
    Source: item = (struct pq_test_item *)all_items[0];
M | 52 | Pointer not checked for null before use : pq | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: pq = priorityq_init(cmp_int, 1);
    Source: all_items = priorityq_items(pq);
M | 82 | Pointer not checked for null before use : pq | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: pq = priorityq_init(cmp_int, 1);
    Source: priorityq_add(pq, &items[j].item);
M | 44 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: pool = pool_alloconly_create("priorityq items", 1024);
    Source: p_clear(pool);
M | 82 | Pointer not checked for null before use : pool | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: pool = pool_alloconly_create("priorityq items", 1024);
    Source: priorityq_add(pq, &items[j].item);
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 71 |  |
    Source: test_assert(priorityq_pop(pq) == NULL);
    Source: priorityq_deinit(&pq);
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 39 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: pool = pool_alloconly_create("priorityq items", 1024);
    Source: pq = priorityq_init(cmp_int, 1);
M | 79 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 100 |  |
    Source: priorityq_deinit(&pq);
    Source: pq = priorityq_init(cmp_int, 1);
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
    Source: test_assert(priorityq_pop(pq) == NULL);
M | 100 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 92 |  |
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
    Source: priorityq_deinit(&pq);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: pool = pool_alloconly_create("priorityq items", 1024);
    Source: pq = priorityq_init(cmp_int, 1);
M | 82 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: pq = priorityq_init(cmp_int, 1);
    Source: priorityq_add(pq, &items[j].item);
M | 50 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: pq = priorityq_init(cmp_int, 1);
    Source: priorityq_add(pq, &item->item);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
    Source: test_assert(priorityq_pop(pq) == NULL);
M | 92 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 86 |  |
    Source: priorityq_remove(pq, &items[j].item);
    Source: item = (struct pq_test_item *)priorityq_pop(pq);
M | 79 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: pool = pool_alloconly_create("priorityq items", 1024);
    Source: pq = priorityq_init(cmp_int, 1);
M | 32 | Procedure contains UR data flow anomalies. : items.item.idx | CERT EXP33-C
| 82 |  |
    Source: priorityq_add(pq, &items[j].item);
    Source: struct pq_test_item *item, items[PQ_MAX_ITEMS];

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-priorityq.c | 32 | test-priorityq.c | 82 | items.item.idx
    Source: struct pq_test_item *item, items[PQ_MAX_ITEMS];
    Source: priorityq_add(pq, &items[j].item);

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

test_seq_range_array_random (9 to 80 test-seq-range-array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: i_array_init(&range, 1);
    Source: i_array_init(&range, 1);
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| Ref. Line -1105 (Module 736) |  |
    Ref(-1105)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\TEST-SEQ-RANGE-ARRAY_736.ref" looking for line -1105
    Source: i_array_init(&range, 1);
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: seq_range_array_add(&range, 0, seq1);
    Source: test_out_reason("seq_range_array random", FALSE,
M | 42 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 21 |  |
    Source: i_array_init(&range, 1);
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: seq_range_array_add(&range, 0, seq1);
    Source: test_out_reason("seq_range_array random", FALSE,
M | 14 | Procedure contains UR data flow anomalies. : range.arr.buffer | CERT EXP33-C
| 42 |  |
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
    Source: ARRAY_TYPE(seq_range) range;
M | 14 | Procedure contains UR data flow anomalies. : range.arr.element_size | CERT EXP33-C
| 42 |  |
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
    Source: ARRAY_TYPE(seq_range) range;
M | 14 | Procedure contains UR data flow anomalies. : range.v | CERT EXP33-C
| 42 |  |
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
    Source: ARRAY_TYPE(seq_range) range;
M | 14 | Procedure contains UR data flow anomalies. : range.v_modifiable | CERT EXP33-C
| 42 |  |
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
    Source: ARRAY_TYPE(seq_range) range;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-seq-range-array.c | 14 | test-seq-range-array.c | 42 | range.arr.buffer
    Source: ARRAY_TYPE(seq_range) range;
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
test-seq-range-array.c | 14 | test-seq-range-array.c | 42 | range.arr.element_size
    Source: ARRAY_TYPE(seq_range) range;
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
test-seq-range-array.c | 14 | test-seq-range-array.c | 42 | range.v
    Source: ARRAY_TYPE(seq_range) range;
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);
test-seq-range-array.c | 14 | test-seq-range-array.c | 42 | range.v_modifiable
    Source: ARRAY_TYPE(seq_range) range;
    Source: ret = seq_range_array_remove_range(&range, seq1, seq2);

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

test_seq_range_array_invert (82 to 123 test-seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 119 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: seq_range_array_invert(&range, input_min, input_max);
    Source: test_out(t_strdup_printf("seq_range_array_invert(%u)", num),
M | 109 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: seq_range_array_add(&range, 32, input[i]);
    Source: seq_range_array_invert(&range, input_min, input_max);
M | 119 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 109 |  |
    Source: seq_range_array_invert(&range, input_min, input_max);
    Source: test_out(t_strdup_printf("seq_range_array_invert(%u)", num),
M | 109 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: seq_range_array_add(&range, 32, input[i]);
    Source: seq_range_array_invert(&range, input_min, input_max);

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

test_seq_range_create (125 to 134 test-seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 132 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 129 |  |
    Source: array_clear(array);
    Source: seq_range_array_add(array, 0, i + 1);
M | 132 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 129 |  |
    Source: array_clear(array);
    Source: seq_range_array_add(array, 0, i + 1);

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

test_seq_range_array_have_common (136 to 155 test-seq-range-array.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 142 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: t_array_init(&arr1, 8);
    Source: t_array_init(&arr1, 8);
M | 142 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: t_array_init(&arr1, 8);
    Source: t_array_init(&arr1, 8);
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: t_array_init(&arr1, 8);
    Source: t_array_init(&arr2, 8);
M | 143 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 142 |  |
    Source: t_array_init(&arr1, 8);
    Source: t_array_init(&arr2, 8);
M | 143 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: t_array_init(&arr2, 8);
    Source: t_array_init(&arr2, 8);
M | 143 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: t_array_init(&arr2, 8);
    Source: t_array_init(&arr2, 8);
M | 145 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: t_array_init(&arr2, 8);
    Source: test_seq_range_create(&arr1, i);
M | 147 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 145 |  |
    Source: test_seq_range_create(&arr1, i);
    Source: test_seq_range_create(&arr2, j);
M | 145 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 143 |  |
    Source: t_array_init(&arr2, 8);
    Source: test_seq_range_create(&arr1, i);
M | 147 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 145 |  |
    Source: test_seq_range_create(&arr1, i);
    Source: test_seq_range_create(&arr2, j);
M | 138 | Procedure contains UR data flow anomalies. : arr1.arr.buffer | CERT EXP33-C
| 145 |  |
    Source: test_seq_range_create(&arr1, i);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr1.arr.element_size | CERT EXP33-C
| 145 |  |
    Source: test_seq_range_create(&arr1, i);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr1.v | CERT EXP33-C
| 148 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr1.v_modifiable | CERT EXP33-C
| 148 |  |
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr2.arr.buffer | CERT EXP33-C
| 147 |  |
    Source: test_seq_range_create(&arr2, j);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr2.arr.element_size | CERT EXP33-C
| 147 |  |
    Source: test_seq_range_create(&arr2, j);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr2.v | CERT EXP33-C
| 148 |  |
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
M | 138 | Procedure contains UR data flow anomalies. : arr2.v_modifiable | CERT EXP33-C
| 148 |  |
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
    Source: ARRAY_TYPE(seq_range) arr1, arr2;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
test-seq-range-array.c | 138 | test-seq-range-array.c | 145 | arr1.arr.buffer
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: test_seq_range_create(&arr1, i);
test-seq-range-array.c | 138 | test-seq-range-array.c | 145 | arr1.arr.element_size
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: test_seq_range_create(&arr1, i);
test-seq-range-array.c | 138 | test-seq-range-array.c | 148 | arr1.v
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
test-seq-range-array.c | 138 | test-seq-range-array.c | 148 | arr1.v_modifiable
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
test-seq-range-array.c | 138 | test-seq-range-array.c | 147 | arr2.arr.buffer
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: test_seq_range_create(&arr2, j);
test-seq-range-array.c | 138 | test-seq-range-array.c | 147 | arr2.arr.element_size
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: test_seq_range_create(&arr2, j);
test-seq-range-array.c | 138 | test-seq-range-array.c | 148 | arr2.v
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);
test-seq-range-array.c | 138 | test-seq-range-array.c | 148 | arr2.v_modifiable
    Source: ARRAY_TYPE(seq_range) arr1, arr2;
    Source: ret1 = seq_range_array_have_common(&arr1, &arr2);

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

test_seq_range_array (157 to 162 test-seq-range-array.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 160 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 159 |  |
    Source: test_seq_range_array_invert();
    Source: test_seq_range_array_have_common();
M | 160 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 159 |  |
    Source: test_seq_range_array_invert();
    Source: test_seq_range_array_have_common();
M | 161 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 160 |  |
    Source: test_seq_range_array_have_common();
    Source: test_seq_range_array_random();
M | 161 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 160 |  |
    Source: test_seq_range_array_have_common();
    Source: test_seq_range_array_random();

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

test_str_find_substring (8 to 51 test-str-find.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 10 | Pointer not checked for null before use : str_find_text | CERT EXP08-C,EXP34-C
| 6 |  |
    Source: static const char *str_find_text = "xababcd";
    Source: const unsigned char *text = (const unsigned char *)str_find_text;
M | 21 | Pointer not checked for null before use : ctx | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: ctx = str_find_init(pool_datastack_create(), key);
    Source: str_find_reset(ctx);
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: if (str_find_more(ctx, text+pos, j-pos+1)) {
    Source: if (str_find_more(ctx, text+pos, j-pos))
M | 25 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: ctx = str_find_init(pool_datastack_create(), key);
    Source: if (str_find_more(ctx, text+pos, j-pos+1)) {
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: if (str_find_more(ctx, text+pos, j-pos+1)) {
    Source: if (str_find_more(ctx, text+pos, j-pos))
M | 25 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 16 |  |
    Source: ctx = str_find_init(pool_datastack_create(), key);
    Source: if (str_find_more(ctx, text+pos, j-pos+1)) {

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

test_str_find (58 to 85 test-str-find.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 82 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(fail_input) && success; i++)
M | 74 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: T_BEGIN {
    Source: key = t_strndup(str_find_text + idx, len);
M | 74 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: T_BEGIN {
    Source: key = t_strndup(str_find_text + idx, len);
M | 75 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: key = t_strndup(str_find_text + idx, len);
    Source: p = strstr(str_find_text, key);
M | 76 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: key = t_strndup(str_find_text + idx, len);
    Source: success = test_str_find_substring(key, p - str_find_text);
M | 76 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: key = t_strndup(str_find_text + idx, len);
    Source: success = test_str_find_substring(key, p - str_find_text);
M | 77 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: success = test_str_find_substring(key, p - str_find_text);
    Source: } T_END;
M | 77 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 76 |  |
    Source: success = test_str_find_substring(key, p - str_find_text);
    Source: } T_END;
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: } T_END;
    Source: T_BEGIN {
M | 83 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: } T_END;
    Source: success = test_str_find_substring(fail_input[i], -1);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: } T_END;
    Source: T_BEGIN {
M | 83 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 77 |  |
    Source: } T_END;
    Source: success = test_str_find_substring(fail_input[i], -1);

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

test_str_sanitize (11 to 46 test-str-sanitize.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 43 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: str = str_sanitize(input[i].str, input[i].max_len);
    Source: test_assert(null_strcmp(output[i], str) == 0);

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

test_strescape (12 to 76 test-strescape.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 38 | Negative (or potentially negative) shift. | CERT INT34-C
    Source: test_assert(strlen(escaped) == (1 << CHAR_BIT) - 1 + 3);
M | 39 | Array Bound exceeded. | CERT ARR30-C
    Source: test_assert(escaped['\"'-1] == '\\'); /* 34 */
M | 38 | Pointer not checked for null before use : escaped | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: escaped = str_escape((char *)buf);
    Source: test_assert(strlen(escaped) == (1 << CHAR_BIT) - 1 + 3);
M | 55 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 54 |  |
    Source: str_truncate(str, 0);
    Source: str_append_unescaped(str, unesc[i].input, strlen(unesc[i].input));
M | 55 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 54 |  |
    Source: str_truncate(str, 0);
    Source: str_append_unescaped(str, unesc[i].input, strlen(unesc[i].input));
M | 56 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: str_append_unescaped(str, unesc[i].input, strlen(unesc[i].input));
    Source: test_assert(strcmp(str_c(str), unesc[i].output) == 0);
M | 56 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 55 |  |
    Source: str_append_unescaped(str, unesc[i].input, strlen(unesc[i].input));
    Source: test_assert(strcmp(str_c(str), unesc[i].output) == 0);
M | 67 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: str_truncate(str, 0);
    Source: str_append_tabunescaped(str, tabesc[i].output, strlen(tabesc[i].output));
M | 67 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: str_truncate(str, 0);
    Source: str_append_tabunescaped(str, tabesc[i].output, strlen(tabesc[i].output));
M | 68 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: str_append_tabunescaped(str, tabesc[i].output, strlen(tabesc[i].output));
    Source: test_assert(strcmp(str_c(str), tabesc[i].input) == 0);
M | 68 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 67 |  |
    Source: str_append_tabunescaped(str, tabesc[i].output, strlen(tabesc[i].output));
    Source: test_assert(strcmp(str_c(str), tabesc[i].input) == 0);
M | 72 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: str_truncate(str, 0);
    Source: str_append_tabunescaped(str, tabstr, strlen(tabstr));
M | 72 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 70 |  |
    Source: str_truncate(str, 0);
    Source: str_append_tabunescaped(str, tabstr, strlen(tabstr));
M | 73 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 72 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: str_append_tabunescaped(str, tabstr, strlen(tabstr));
    Source: test_assert(strcmp(str_c(str), "2l") == 0);
M | 73 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 72 |  |
    Source: str_append_tabunescaped(str, tabstr, strlen(tabstr));
    Source: test_assert(strcmp(str_c(str), "2l") == 0);
M | 54 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 49 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: test_assert(strcmp(str_escape("\\\\\"\"\'\'"),
    Source: str = t_str_new(256);
M | 66 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: test_assert(strcmp(str_tabescape(tabesc[i].input),
    Source: str_truncate(str, 0);
M | 74 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: test_assert(strcmp(str_c(str), "2l") == 0);
    Source: test_assert(strcmp(str_c(str), str_tabunescape(t_strdup_noconst(tabstr))) == 0);
M | 70 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: test_assert(strcmp(str_c(str), tabesc[i].input) == 0);
    Source: str_truncate(str, 0);
M | 54 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 45 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: escaped = str_escape((char *)buf);
    Source: test_assert(strcmp(str_escape("\\\\\"\"\'\'"),
M | 49 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 45 |  |
    Source: test_assert(strcmp(str_escape("\\\\\"\"\'\'"),
    Source: str = t_str_new(256);
M | 66 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 64 |  |
    Source: test_assert(strcmp(str_tabescape(tabesc[i].input),
    Source: str_truncate(str, 0);
M | 74 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 73 |  |
    Source: test_assert(strcmp(str_c(str), "2l") == 0);
    Source: test_assert(strcmp(str_c(str), str_tabunescape(t_strdup_noconst(tabstr))) == 0);
M | 70 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 68 |  |
    Source: test_assert(strcmp(str_c(str), tabesc[i].input) == 0);
    Source: str_truncate(str, 0);

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 54 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 49 |  |
    Source: str = t_str_new(256);
    Source: str_truncate(str, 0);
M | 45 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 37 |  |
    Source: escaped = str_escape((char *)buf);
    Source: test_assert(strcmp(str_escape("\\\\\"\"\'\'"),

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

test_p_strarray_dup (5 to 28 test-strfuncs.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 18 | Sizeof argument is a pointer. | CERT EXP01-C
    Source: for (i = 0; i < N_ELEMENTS(input); i++) {
M | 20 | Array Bound exceeded. | CERT ARR30-C
    Source: for (j = 0; input[i][j] != NULL; j++) {
M | 21 | Array Bound exceeded. | CERT ARR30-C
    Source: test_assert(strcmp(input[i][j], ret[j]) == 0);
M | 22 | Array Bound exceeded. | CERT ARR30-C
    Source: test_assert(input[i][j] != ret[j]);
M | 25 | free parameter is not heap item. | CERT MEM34-C
    Source: i_free(ret);
M | 21 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 19 |  |
    Source: ret = p_strarray_dup(default_pool, input[i]);
    Source: test_assert(strcmp(input[i][j], ret[j]) == 0);
M | 19 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 25 |  |
    Source: i_free(ret);
    Source: ret = p_strarray_dup(default_pool, input[i]);
M | 19 | Attempt to read from freed memory. : default_pool | CERT MEM30-C
    Source: ret = p_strarray_dup(default_pool, input[i]);

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

test_utc_mktime (10 to 56 test-utc-mktime.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: test_out_reason(t_strdup_printf("utc_mktime(%d)", i), success,
    Source: success ? NULL : t_strdup_printf("%ld != %ld",
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: test_out_reason(t_strdup_printf("utc_mktime(%d)", i), success,
    Source: success ? NULL : t_strdup_printf("%ld != %ld",
M | 52 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: success ? NULL : t_strdup_printf("%ld != %ld",
    Source: test_out_reason(t_strdup_printf("utc_mktime(%d)", i), success,
M | 52 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 53 |  |
    Source: success ? NULL : t_strdup_printf("%ld != %ld",
    Source: test_out_reason(t_strdup_printf("utc_mktime(%d)", i), success,

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

test_var_expand_builtin (14 to 38 test-var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: string_t *str = t_str_new(128);
    Source: env_put("FOO=baR");
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: string_t *str = t_str_new(128);
    Source: env_put("FOO=baR");
M | 34 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: str_truncate(str, 0);
    Source: var_expand(str, tests[i].in, table);
M | 34 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 33 |  |
    Source: str_truncate(str, 0);
    Source: var_expand(str, tests[i].in, table);
M | 35 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: var_expand(str, tests[i].in, table);
    Source: test_assert(strcmp(tests[i].out, str_c(str)) == 0);
M | 35 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 34 |  |
    Source: var_expand(str, tests[i].in, table);
    Source: test_assert(strcmp(tests[i].out, str_c(str)) == 0);
M | 27 | Pointer not checked for null before use : my_hostname | CERT EXP08-C,EXP34-C
| Ref. Line -1852 (Module 743) |  |
    Ref(-1852)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\TEST-VAR-EXPAND_743.ref" looking for line -1852
    Source: tests[0].out = my_hostname;
M | 28 | Pointer not checked for null before use : my_pid | CERT EXP08-C,EXP34-C
| Ref. Line -1855 (Module 743) |  |
    Ref(-1855)Warning: Reached end of file "C:\LDRA_WORKAREA\CCPP_830_Release\Dovecot-src-lib_tbwrkfls\TEST-VAR-EXPAND_743.ref" looking for line -1855
    Source: tests[1].out = my_pid;
M | 35 | Pointer not checked for null before use : tests.out | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: tests[1].out = my_pid;
    Source: test_assert(strcmp(tests[i].out, str_c(str)) == 0);
M | 33 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: string_t *str = t_str_new(128);
    Source: str_truncate(str, 0);
M | 33 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: env_put("FOO=baR");
    Source: str_truncate(str, 0);
M | 33 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 29 |  |
    Source: env_put("FOO=baR");
    Source: str_truncate(str, 0);

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

uni_utf8_get_char_n (35 to 94 unichar.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: i_assert(max_len > 0);
    Source: i_assert(len == 1);
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 42 |  |
    Source: i_assert(max_len > 0);
    Source: i_assert(len == 1);

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

uni_utf8_to_ucs4 (96 to 110 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 107 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: if (uni_utf8_get_char(input, &chr) <= 0) {
    Source: array_append(output, &chr, 1);
M | 101 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: array_append(output, &chr, 1);
    Source: if (uni_utf8_get_char(input, &chr) <= 0) {
M | 107 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 101 |  |
    Source: if (uni_utf8_get_char(input, &chr) <= 0) {
    Source: array_append(output, &chr, 1);
M | 101 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 107 |  |
    Source: array_append(output, &chr, 1);
    Source: if (uni_utf8_get_char(input, &chr) <= 0) {
M | 98 | Procedure contains UR data flow anomalies. : chr | CERT EXP33-C
| 107 |  |
    Source: array_append(output, &chr, 1);
    Source: unichar_t chr;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 98 | unichar.c | 107 | chr
    Source: unichar_t chr;
    Source: array_append(output, &chr, 1);

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

uni_ucs4_to_utf8_c (118 to 157 unichar.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 151 | Negative (or potentially negative) shift. | CERT INT34-C
    Source: buffer_append_c(output, first | (chr >> bitpos));
M | 155 | Negative (or potentially negative) shift. | CERT INT34-C
    Source: buffer_append_c(output, 0x80 | ((chr >> bitpos) & 0x3f));
M | 155 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 151 |  |
    Source: buffer_append_c(output, first | (chr >> bitpos));
    Source: buffer_append_c(output, 0x80 | ((chr >> bitpos) & 0x3f));
M | 151 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 128 |  |
    Source: i_assert(chr < 0x80000000); /* 1 << (5*6 + 1) */
    Source: buffer_append_c(output, first | (chr >> bitpos));
M | 155 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 151 |  |
    Source: buffer_append_c(output, first | (chr >> bitpos));
    Source: buffer_append_c(output, 0x80 | ((chr >> bitpos) & 0x3f));
M | 151 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 128 |  |
    Source: i_assert(chr < 0x80000000); /* 1 << (5*6 + 1) */
    Source: buffer_append_c(output, first | (chr >> bitpos));

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

uni_ucs4_to_titlecase (186 to 205 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 188 | Procedure contains UR data flow anomalies. : idx | CERT EXP33-C
| 197 |  |
    Source: return titlecase16_values[idx];
    Source: unsigned int idx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 188 | unichar.c | 197 | idx
    Source: unsigned int idx;
    Source: return titlecase16_values[idx];

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

uni_ucs4_decompose_uni (207 to 230 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 209 | Procedure contains UR data flow anomalies. : idx | CERT EXP33-C
| 227 |  |
    Source: *chr = uni32_decomp_values[idx];
    Source: unsigned int idx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 209 | unichar.c | 227 | idx
    Source: unsigned int idx;
    Source: *chr = uni32_decomp_values[idx];

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

uni_ucs4_decompose_hangul_utf8 (232 to 250 unichar.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 248 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 247 |  |
    Source: uni_ucs4_to_utf8_c(L, output);
    Source: uni_ucs4_to_utf8_c(V, output);
M | 248 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 247 |  |
    Source: uni_ucs4_to_utf8_c(L, output);
    Source: uni_ucs4_to_utf8_c(V, output);
M | 249 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 248 |  |
    Source: uni_ucs4_to_utf8_c(V, output);
    Source: if (T != TBase) uni_ucs4_to_utf8_c(T, output);
M | 249 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 248 |  |
    Source: uni_ucs4_to_utf8_c(V, output);
    Source: if (T != TBase) uni_ucs4_to_utf8_c(T, output);

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

uni_ucs4_decompose_multi_utf8 (252 to 268 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 255 | Procedure contains UR data flow anomalies. : idx | CERT EXP33-C
| 264 |  |
    Source: value = &multidecomp_values[multidecomp_offsets[idx]];
    Source: unsigned int idx;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 255 | unichar.c | 264 | idx
    Source: unsigned int idx;
    Source: value = &multidecomp_values[multidecomp_offsets[idx]];

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

uni_utf8_to_decomposed_titlecase (286 to 314 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 295 | Pointer not checked for null before use : input | CERT EXP08-C,EXP34-C
| 298 |  |
    Source: input++; max_len--;
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
M | 299 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 295 |  |
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
    Source: output_add_replacement_char(output);
M | 311 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 310 |  |
    Source: !uni_ucs4_decompose_multi_utf8(chr, output))
    Source: uni_ucs4_to_utf8_c(chr, output);
M | 295 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 299 |  |
    Source: output_add_replacement_char(output);
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
M | 308 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 295 |  |
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
    Source: uni_ucs4_decompose_hangul_utf8(chr, output);
M | 299 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 295 |  |
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
    Source: output_add_replacement_char(output);
M | 311 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 310 |  |
    Source: !uni_ucs4_decompose_multi_utf8(chr, output))
    Source: uni_ucs4_to_utf8_c(chr, output);
M | 295 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 299 |  |
    Source: output_add_replacement_char(output);
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
M | 308 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 295 |  |
    Source: if (uni_utf8_get_char_n(input, max_len, &chr) <= 0) {
    Source: uni_ucs4_decompose_hangul_utf8(chr, output);
M | 291 | Procedure contains UR data flow anomalies. : chr | CERT EXP33-C
| 306 |  |
    Source: chr = uni_ucs4_to_titlecase(chr);
    Source: unichar_t chr;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 291 | unichar.c | 306 | chr
    Source: unichar_t chr;
    Source: chr = uni_ucs4_to_titlecase(chr);

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

uni_utf8_get_valid_data (354 to 382 unichar.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 365 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 363 |  |
    Source: buffer_append(buf, input, i++);
    Source: output_add_replacement_char(buf);
M | 365 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 363 |  |
    Source: buffer_append(buf, input, i++);
    Source: output_add_replacement_char(buf);
M | 368 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: output_add_replacement_char(buf);
    Source: buffer_append_c(buf, input[i++]);
M | 378 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: output_add_replacement_char(buf);
    Source: buffer_append(buf, input + i, len);
M | 368 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: output_add_replacement_char(buf);
    Source: buffer_append_c(buf, input[i++]);
M | 378 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 365 |  |
    Source: output_add_replacement_char(buf);
    Source: buffer_append(buf, input + i, len);
M | 357 | Procedure contains UR data flow anomalies. : i | CERT EXP33-C
| 363 |  |
    Source: buffer_append(buf, input, i++);
    Source: size_t i, len;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
unichar.c | 357 | unichar.c | 363 | i
    Source: size_t i, len;
    Source: buffer_append(buf, input, i++);

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

unix_socket_create (10 to 34 unix-socket-create.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 29 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: i_error("chown(%s, %s, %s) failed: %m",
    Source: path, dec2str(uid), dec2str(gid));
M | 29 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 28 |  |
    Source: i_error("chown(%s, %s, %s) failed: %m",
    Source: path, dec2str(uid), dec2str(gid));
M | 21 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: fd = net_listen_unix_unlink_stale(path, backlog);
    Source: i_error("net_listen_unix(%s) failed: %m", path);
M | 28 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: fd = net_listen_unix_unlink_stale(path, backlog);
    Source: i_error("chown(%s, %s, %s) failed: %m",
M | 21 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: fd = net_listen_unix_unlink_stale(path, backlog);
    Source: i_error("net_listen_unix(%s) failed: %m", path);
M | 28 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 17 |  |
    Source: fd = net_listen_unix_unlink_stale(path, backlog);
    Source: i_error("chown(%s, %s, %s) failed: %m",

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

unlink_directory_r (44 to 145 unlink-directory.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 127 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 111 |  |
    Source: if (unlink_directory_r(d->d_name) < 0) {
    Source: i_error("unlink(%s/%s) failed: %m",
M | 127 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 111 |  |
    Source: if (unlink_directory_r(d->d_name) < 0) {
    Source: i_error("unlink(%s/%s) failed: %m",

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

unlink_directory (147 to 177 unlink-directory.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 161 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 155 |  |
    Source: ret = unlink_directory_r(dir);
    Source: i_fatal("unlink_directory(%s): "
M | 161 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 155 |  |
    Source: ret = unlink_directory_r(dir);
    Source: i_fatal("unlink_directory(%s): "

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

unlink_old_files_real (15 to 73 unlink-old-files.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 32 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: path = t_str_new(256);
    Source: str_printfa(path, "%s/", dir);
M | 32 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: path = t_str_new(256);
    Source: str_printfa(path, "%s/", dir);
M | 32 | Pointer not checked for null before use : path | CERT EXP08-C,EXP34-C
| 31 |  |
    Source: path = t_str_new(256);
    Source: str_printfa(path, "%s/", dir);
M | 47 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: str_truncate(path, dir_len);
    Source: str_append(path, d->d_name);
M | 47 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 46 |  |
    Source: str_truncate(path, dir_len);
    Source: str_append(path, d->d_name);
M | 48 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: str_append(path, d->d_name);
    Source: if (stat(str_c(path), &st) < 0) {
M | 48 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 47 |  |
    Source: str_append(path, d->d_name);
    Source: if (stat(str_c(path), &st) < 0) {
M | 50 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: if (stat(str_c(path), &st) < 0) {
    Source: i_error("stat(%s) failed: %m", str_c(path));
M | 53 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: if (unlink(str_c(path)) < 0 && errno != ENOENT)
    Source: i_error("unlink(%s) failed: %m", str_c(path));
M | 71 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: i_error("fstat(%s) failed: %m", dir);
    Source: i_error("closedir(%s) failed: %m", dir);
M | 59 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: str_printfa(path, "%s/", dir);
    Source: i_error("fstat(%s) failed: %m", dir);
M | 52 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: if (stat(str_c(path), &st) < 0) {
    Source: if (unlink(str_c(path)) < 0 && errno != ENOENT)
M | 50 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |

Code | Line | Violation | Standard
--- | --- | --- | ---
    Source: if (stat(str_c(path), &st) < 0) {
    Source: i_error("stat(%s) failed: %m", str_c(path));
M | 53 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 52 |  |
    Source: if (unlink(str_c(path)) < 0 && errno != ENOENT)
    Source: i_error("unlink(%s) failed: %m", str_c(path));
M | 71 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 59 |  |
    Source: i_error("fstat(%s) failed: %m", dir);
    Source: i_error("closedir(%s) failed: %m", dir);
M | 59 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 32 |  |
    Source: str_printfa(path, "%s/", dir);
    Source: i_error("fstat(%s) failed: %m", dir);
M | 52 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: if (stat(str_c(path), &st) < 0) {
    Source: if (unlink(str_c(path)) < 0 && errno != ENOENT)

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

unlink_old_files (75 to 83 unlink-old-files.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 80 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: T_BEGIN {
    Source: ret = unlink_old_files_real(dir, prefix, min_time);
M | 80 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 79 |  |
    Source: T_BEGIN {
    Source: ret = unlink_old_files_real(dir, prefix, min_time);
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: ret = unlink_old_files_real(dir, prefix, min_time);
    Source: } T_END;
M | 81 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 80 |  |
    Source: ret = unlink_old_files_real(dir, prefix, min_time);
    Source: } T_END;

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

utc_mktime (23 to 53 utc-mktime.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 40 | Pointer not checked for null before use : try_tm | CERT EXP08-C,EXP34-C
| 39 |  |
    Source: try_tm = gmtime(&t);
    Source: dir = tm_cmp(tm, try_tm);

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

m_str_reverse (57 to 69 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 68 | Attempt to use already freed object. | CERT MEM31-C
    Source: return rev;
M | 67 | Pointer not checked for null before use : p | CERT EXP08-C,EXP34-C
| 66 |  |
    Source: for (p = rev + len - 1; *str != '\0'; str++)
    Source: *p-- = *str;

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

m_str_hash (71 to 87 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 81 | Pointer not checked for null before use : hash | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: string_t *hash = t_str_new(20);
    Source: str_printfa(hash, "%x", value);
M | 81 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: string_t *hash = t_str_new(20);
    Source: str_printfa(hash, "%x", value);
M | 86 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: str_printfa(hash, "%x", value);
    Source: return str_c(hash);
M | 81 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 74 |  |
    Source: string_t *hash = t_str_new(20);
    Source: str_printfa(hash, "%x", value);
M | 86 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 81 |  |
    Source: str_printfa(hash, "%x", value);
    Source: return str_c(hash);

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

m_str_ldap_dn (99 to 113 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 112 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: string_t *ret = t_str_new(256);
    Source: return str_free_without_data(&ret);
M | 106 | Pointer not checked for null before use : ret | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: string_t *ret = t_str_new(256);
    Source: str_append(ret, ",dc=");
M | 112 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: string_t *ret = t_str_new(256);
    Source: return str_free_without_data(&ret);
M | 112 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 102 |  |
    Source: string_t *ret = t_str_new(256);
    Source: return str_free_without_data(&ret);

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

var_expand_long (140 to 173 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 157 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: T_BEGIN {
    Source: const char *key = t_strndup(key_start, key_len);
M | 157 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 156 |  |
    Source: T_BEGIN {
    Source: const char *key = t_strndup(key_start, key_len);
M | 147 | Pointer not checked for null before use : t | CERT EXP08-C,EXP34-C
| 147 |  |
    Source: for (t = table; !TABLE_LAST(t); t++) {
    Source: for (t = table; !TABLE_LAST(t); t++) {
M | 171 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: const char *key = t_strndup(key_start, key_len);
    Source: } T_END;
M | 171 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: const char *key = t_strndup(key_start, key_len);
    Source: } T_END;
M | 161 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: const char *key = t_strndup(key_start, key_len);
    Source: if (strcmp(key, "pid") == 0)
M | 165 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: const char *key = t_strndup(key_start, key_len);
    Source: if (strcmp(key, "hostname") == 0)
M | 169 | Pointer not checked for null before use : key | CERT EXP08-C,EXP34-C
| 157 |  |
    Source: const char *key = t_strndup(key_start, key_len);
    Source: if (strncmp(key, "env:", 4) == 0)

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

var_expand (175 to 307 var-expand.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 234 | Pointer not checked for null before use : m | CERT EXP08-C,EXP34-C
| 234 |  |
    Source: for (m = modifiers; m->key != '\0'; m++) {
    Source: for (m = modifiers; m->key != '\0'; m++) {
M | 259 | Pointer not checked for null before use : t | CERT EXP08-C,EXP34-C
| 259 |  |
    Source: for (t = table; !TABLE_LAST(t); t++) {
    Source: for (t = table; !TABLE_LAST(t); t++) {
M | 286 | Pointer not checked for null before use : var | CERT EXP08-C,EXP34-C
| 288 |  |
    Source: var++;
    Source: while (*var != '\0' && ctx.offset > 0) {
M | 276 | Pointer not checked for null before use : var | CERT EXP08-C,EXP34-C
| 276 |  |
    Source: var = modifier[i](var, &ctx);
    Source: var = modifier[i](var, &ctx);
M | 292 | Pointer not checked for null before use : var | CERT EXP08-C,EXP34-C
| 284 |  |
    Source: var += len + ctx.offset;
    Source: str_append(dest, var);
M | 302 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 299 |  |
    Source: str_append_c(dest, '0');
    Source: str_append(dest, var);
M | 190 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 292 |  |
    Source: str_append(dest, var);
    Source: str_append_c(dest, *str);
M | 302 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 299 |  |
    Source: str_append_c(dest, '0');
    Source: str_append(dest, var);
M | 190 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 292 |  |
    Source: str_append(dest, var);
    Source: str_append_c(dest, *str);
M | 184 | Procedure contains UR data flow anomalies. : end | CERT EXP33-C
| 254 |  |
    Source: len = end - (str + 1);
    Source: const char *end;
M | 251 | Procedure contains UR data flow anomalies. : var | CERT EXP33-C
| 180 |  |
    Source: const char *var;
    Source: var = NULL;

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
var-expand.c | 184 | var-expand.c | 254 | end
    Source: const char *end;
    Source: len = end - (str + 1);
var-expand.c | 251 | var-expand.c | 268 | var
    Source: var = NULL;
    Source: if (var == NULL) {

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

var_get_key (309 to 333 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 324 | Pointer not checked for null before use : m | CERT EXP08-C,EXP34-C
| 324 |  |
    Source: for (m = modifiers; m->key != '\0'; m++) {
    Source: for (m = modifiers; m->key != '\0'; m++) {

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

var_has_key (354 to 372 var-expand.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 358 | Pointer not checked for null before use : str | CERT EXP08-C,EXP34-C
| 366 |  |
    Source: if (var_has_long_key(&str, long_key))
    Source: for (; *str != '\0'; str++) {

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

var_expand_table_build (374 to 399 var-expand.c) - FAIL

#### Standards Violation Summary

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

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 383 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 383 |  |
    Source: t_array_init(&variables, 16);
    Source: t_array_init(&variables, 16);
M | 383 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 383 |  |
    Source: t_array_init(&variables, 16);
    Source: t_array_init(&variables, 16);
M | 383 | Pointer not checked for null before use : default_pool | CERT EXP08-C,EXP34-C
| 381 |  |
    Source: i_assert(key != '\0');
    Source: t_array_init(&variables, 16);
M | 383 | Pointer not checked for null before use : current_ioloop | CERT EXP08-C,EXP34-C
| 381 |  |
    Source: i_assert(key != '\0');
    Source: t_array_init(&variables, 16);
M | 377 | Procedure contains UR data flow anomalies. : variables.arr.buffer | CERT EXP33-C
| 384 |  |
    Source: var = array_append_space(&variables);
    Source: ARRAY_DEFINE(variables, struct var_expand_table);
M | 377 | Procedure contains UR data flow anomalies. : variables.arr.element_size | CERT EXP33-C
| 384 |  |
    Source: var = array_append_space(&variables);
    Source: ARRAY_DEFINE(variables, struct var_expand_table);

#### Possible UR Anomalies

The following variables may be referenced before being given a value

File | Undefine | File | Reference | Variable
--- | --- | --- | --- | ---
var-expand.c | 377 | var-expand.c | 384 | variables.arr.buffer
    Source: ARRAY_DEFINE(variables, struct var_expand_table);
    Source: var = array_append_space(&variables);
var-expand.c | 377 | var-expand.c | 384 | variables.arr.element_size
    Source: ARRAY_DEFINE(variables, struct var_expand_table);
    Source: var = array_append_space(&variables);

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

wildcard_match_int (26 to 93 wildcard-match.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 39 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 38 |  |
    Source: while (*(++data));
    Source: data--;
M | 37 | Pointer not checked for null before use : mask | CERT EXP08-C,EXP34-C
| 36 |  |
    Source: while (*(++mask));
    Source: mask--;
M | 46 | Pointer not checked for null before use : lsn | CERT EXP08-C,EXP34-C
| 62 |  |
    Source: lsn = data;
    Source: data = --lsn;

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

write_full (8 to 29 write-full.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 13 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 24 |  |
    Source: data = CONST_PTR_OFFSET(data, ret);
    Source: ret = write(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX);

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

pwrite_full (31 to 54 write-full.c) - FAIL

#### Standards Violation Summary

Code | Line | Violation | Standard
--- | --- | --- | ---
M | 36 | Pointer not checked for null before use : data | CERT EXP08-C,EXP34-C
| 48 |  |
    Source: data = CONST_PTR_OFFSET(data, ret);
    Source: ret = pwrite(fd, data, size < SSIZE_T_MAX ?

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

### End of Code Review Report

###

### Copyright © 2010 Liverpool Data Research Associates