~ubuntu-branches/ubuntu/trusty/vsftpd/trusty-proposed

« back to all changes in this revision

Viewing changes to strlist.c

  • Committer: Package Import Robot
  • Author(s): Lorenzo De Liso
  • Date: 2012-12-18 19:59:37 UTC
  • mfrom: (2.3.22 sid)
  • Revision ID: package-import@ubuntu.com-20121218195937-xiwdrfndhhvv87s0
Tags: 3.0.2-1ubuntu1
* Merge from debian unstable (LP: #1092076), remaining changes:
  - Use snakeoil SSL certificates and key.
  - debian/rules, debian/vsftpd.upstart: migrate vsftpd to upstart.
  - Add apport hook:
    + debian/vsftpd.apport: Added.
    + debian/control: Build-depends on dh-apport.
    + debian/rules: Add --with apport.
  - Add debian/watch file.
  - debian/patches/09-disable-anonymous.patch: Disable anonymous login by 
    default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
};
23
23
 
24
24
/* File locals */
 
25
static const unsigned int kMaxStrlist = 10 * 1000 * 1000;
 
26
 
25
27
static struct mystr s_null_str;
26
28
 
27
29
static int sort_compare_func(const void* p1, const void* p2);
46
48
  }
47
49
}
48
50
 
49
 
int
 
51
unsigned int
50
52
str_list_get_length(const struct mystr_list* p_list)
51
53
{
52
54
  return p_list->list_len;
78
80
    if (p_list->alloc_len == 0)
79
81
    {
80
82
      p_list->alloc_len = 32;
81
 
      p_list->p_nodes = vsf_sysutil_malloc(p_list->alloc_len *
82
 
                                           sizeof(struct mystr_list_node));
 
83
      p_list->p_nodes = vsf_sysutil_malloc(
 
84
          p_list->alloc_len * (unsigned int) sizeof(struct mystr_list_node));
83
85
    }
84
86
    else
85
87
    {
86
88
      p_list->alloc_len *= 2;
87
 
      p_list->p_nodes = vsf_sysutil_realloc(p_list->p_nodes,
88
 
                                            p_list->alloc_len *
89
 
                                            sizeof(struct mystr_list_node));
 
89
      if (p_list->alloc_len > kMaxStrlist)
 
90
      {
 
91
        die("excessive strlist");
 
92
      }
 
93
      p_list->p_nodes = vsf_sysutil_realloc(
 
94
          p_list->p_nodes,
 
95
          p_list->alloc_len * (unsigned int) sizeof(struct mystr_list_node));
90
96
    }
91
97
  }
92
98
  p_node = &p_list->p_nodes[p_list->list_len];