(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-dict/dict-file.c) |
| |
| 231 | | | static void file_dict_apply_changes(struct file_dict_transaction_context *ctx) |
| 232 | | | { |
| 233 | | | struct file_dict *dict = (struct file_dict *)ctx->ctx.dict; |
| 234 | | | const char *tmp; |
| 235 | | | char *key, *value, *old_value; |
| 236 | | | void *orig_key, *orig_value; |
| 237 | | | const struct file_dict_change *changes; |
| 238 | | | unsigned int i, count, new_len; |
| 239 | | | long long diff; |
| 240 | | | |
| 241 | [+] | | changes = array_get(&ctx->changes, &count);
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
156 | #define array_get(array, count) \ |
157 | ARRAY_TYPE_CAST_CONST(array)array_get_i(&(array)->arr, count) |
| |
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/array.h |
| |
43 | # define ARRAY_TYPE_CAST_CONST(array) \ |
44 | (typeof(*(array)->v)) |
| |
|
 |
| 242 | | | for (i = 0; i < count; i++) { |
Event 1:
Entering loop body. i < count evaluates to true.
hide
|
|
| 243 | | | if (hash_table_lookup_full(dict->hash, changes[i].key, |
| 244 | [+] | | &orig_key, &orig_value)) { |
 |
| 245 | | | key = orig_key; |
| 246 | | | old_value = orig_value; |
| 247 | | | } else { |
| 248 | | | key = NULL; |
| 249 | | | old_value = NULL; |
| 250 | | | } |
| 251 | | | value = NULL; |
| 252 | | | |
| 253 | | | switch (changes[i].type) { |
Event 9:
changes[i].type evaluates to 2.
hide
|
|
| 254 | | | case FILE_DICT_CHANGE_TYPE_INC: |
| 255 | | | diff = old_value == NULL ? 0 : |
Event 10:
old_value == (void *)0 evaluates to true.
hide
|
|
| 256 | | | strtoll(old_value, NULL, 10); |
| 257 | | | diff += changes[i].value.diff; |
| 258 | [+] | | tmp = t_strdup_printf("%lld", diff); |
 |
| 259 | | | new_len = strlen(tmp); |
| 260 | | | if (old_value == NULL || new_len > strlen(old_value)) |
Event 43:
Taking true branch. old_value == (void *)0 evaluates to true.
hide
|
|
| 261 | [+] | | value = p_strdup(dict->hash_pool, tmp); |
Event 44:
tmp, which evaluates to the value assigned to ret at data-stack.c:335, is passed to p_strdup() as the second argument. See related event 42.
hide
|
|
 |
| |