Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at deliver.c:568

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

expand_envs

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/deliver/deliver.c)expand/collapse
Show more  
 815  static void expand_envs(const char *user)
 816  {
 817          const struct var_expand_table *table;
 818          const char *value, *const *envs, *home, *env_name;
 819          unsigned int i, count;
 820          string_t *str;
 821   
 822          home = getenv("HOME");
 823   
 824          str = t_str_new(256);
 825          table = get_var_expand_table(user, home);
 826[+]         envs = array_get(&plugin_envs, &count);
 827          for (i = 0; i < count; i++) {
 828                  str_truncate(str, 0);
 829                  var_expand(str, envs[i], table);
 830                  env_put(str_c(str));
 831          }
 832          /* add LDA envs again to make sure they override plugin settings */
 833[+]         envs = array_get(&lda_envs, &count);
 834          for (i = 0; i < count; i++)
 835                  env_put(envs[i]);
 836   
 837          /* get the table again in case plugin envs provided the home 
 838             directory (yea, kludgy) */
 839          if (home == NULL)
 840                  home = getenv("HOME");
 841          table = get_var_expand_table(user, home);
 842   
 843          value = getenv("MAIL_LOCATION");
 844          if (value != NULL)
 845                  value = expand_mail_env(value, table);
 846          env_put(t_strconcat("MAIL=", value, NULL));
 847   
 848          for (i = 1;; i++) {
 849                  env_name = t_strdup_printf("NAMESPACE_%u", i);
 850                  value = getenv(env_name);
 851                  if (value == NULL)
 852                          break;
 853   
 854[+]                 value = expand_mail_env(value, table);
expand/collapse

expand_mail_env

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/deliver/deliver.c)expand/collapse
Show more  
 549  static const char *
 550  expand_mail_env(const char *env, const struct var_expand_table *table)
 551  {
 552          string_t *str;
 553          const char *p;
 554   
 555          str = t_str_new(256);
 556   
 557          /* it's either type:data or just data */
 558          p = strchr(env, ':');
 559          if (p != NULL) {
 560                  while (env != p) {
 561                          str_append_c(str, *env);
 562                          env++;
 563                  }
 564   
 565                  str_append_c(str, *env++);
 566          }
 567   
 568          if (env[0] == '~' && env[1] == '/') {
Show more  
Show more  




Change Warning 8017.24817 : Buffer Overrun

Because they are very similar, this warning shares annotations with warning 8017.24818.

Priority:
State:
Finding:
Owner:
Note: