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

env_put_namespace

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/mail-process.c)expand/collapse
Show more  
 248  env_put_namespace(struct namespace_settings *ns, const char *default_location,
 249                    const struct var_expand_table *table)
 250  {
 251          const char *location;
 252          unsigned int i;
 253          string_t *str;
 254   
 255          if (default_location == NULL)
 256                  default_location = "";
 257   
 258          for (i = 1; ns != NULL; i++, ns = ns->next) {
 259                  location = *ns->location != '\0' ? ns->location :
 260                          default_location;
 261                  location = expand_mail_env(location, table);
 262                  env_put(t_strdup_printf("NAMESPACE_%u=%s", i, location));
 263   
 264                  if (ns->separator != NULL) {
 265                          env_put(t_strdup_printf("NAMESPACE_%u_SEP=%s",
 266[+][+]                                                 i, ns->separator));
expand/collapse

env_put

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/env-util.c)expand/collapse
Show more  
 15  void env_put(const char *env)
 16  {
 17          if (env_pool == NULL) {
 18                  env_pool = pool_alloconly_create(MEMPOOL_GROWING"Environment",
 19                                                   2048);
 20          }
 21[+]         if (putenv(p_strdup(env_pool, env)) != 0)
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  
 267                  }
 268                  if (ns->type != NULL) {
 269                          env_put(t_strdup_printf("NAMESPACE_%u_TYPE=%s",
 270                                                  i, ns->type));
 271                  }
 272                  if (ns->alias_for != NULL) {
 273                          env_put(t_strdup_printf("NAMESPACE_%u_ALIAS=%s",
 274                                                  i, ns->alias_for));
 275                  }
 276                  if (ns->prefix != NULL) {
 277                          /* expand variables, eg. ~%u/ can be useful */
 278                          str = t_str_new(256);
 279                          str_printfa(str, "NAMESPACE_%u_PREFIX=", i);
 280                          var_expand(str, ns->prefix, table);
 281                          env_put(str_c(str));
 282                  }
 283                  if (ns->inbox)
 284                          env_put(t_strdup_printf("NAMESPACE_%u_INBOX=1", i));
 285                  if (ns->hidden)
 286                          env_put(t_strdup_printf("NAMESPACE_%u_HIDDEN=1", i));
 287                  if (strcmp(ns->list, "no") != 0) {
 288                          env_put(t_strdup_printf("NAMESPACE_%u_LIST=%s",
 289                                                  i, ns->list));
 290                  }
 291                  if (ns->subscriptions)
 292                          env_put(t_strdup_printf("NAMESPACE_%u_SUBSCRIPTIONS=1",
 293                                                  i));
Show more  




Change Warning 7725.24763 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: