Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at strfuncs.c:39

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

file_dict_apply_changes

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-dict/dict-file.c)expand/collapse
Show more  
 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);
 242          for (i = 0; i < count; i++) {
 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) {
 254                  case FILE_DICT_CHANGE_TYPE_INC:
 255                          diff = old_value == NULL ? 0 :
 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))
 261[+]                                 value = p_strdup(dict->hash_pool, tmp);
expand/collapse

p_strdup

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/strfuncs.c)expand/collapse
Show more  
 31  char *p_strdup(pool_t pool, const char *str)
 32  {
 33          void *mem;
 34          size_t len;
 35   
 36          if (str == NULL)
 37                  return NULL;
 38   
 39          for (len = 0; (str)[len] != '\0'; )
 40                  len++;
Show more  
Show more  




Change Warning 7146.24793 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: