~ubuntu-branches/ubuntu/saucy/sudo/saucy

« back to all changes in this revision

Viewing changes to common/alloc.c

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-11-16 09:31:32 UTC
  • mfrom: (1.4.13)
  • Revision ID: package-import@ubuntu.com-20121116093132-ptext55adlzbrq6y
Tags: 1.8.6p3-0ubuntu1
* New upstream release (1.8.6p3).
* Add patch to fix building with sssd when ldap is disabled.
* Drop sudo.manpages and sudo-ldap.manpages as the upstream build system
  now does the right thing here.
* Build the main sudo package with support for sssd, this doesn't add any
  additional build time or runtime dependency. sudo will dynamically load
  the sssd library if 'sss' is listed for the 'sudoers' nss service.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    if (nmemb == 0 || size == 0)
99
99
        errorx2(1, _("internal error, tried to emalloc2(0)"));
100
100
    if (nmemb > SIZE_MAX / size)
101
 
        errorx2(1, _("internal error, emalloc2() overflow"));
 
101
        errorx2(1, _("internal error, %s overflow"), "emalloc2()");
102
102
 
103
103
    size *= nmemb;
104
104
    if ((ptr = malloc(size)) == NULL)
120
120
        errorx2(1, _("internal error, tried to ecalloc(0)"));
121
121
    if (nmemb != 1) {
122
122
        if (nmemb > SIZE_MAX / size)
123
 
            errorx2(1, _("internal error, ecalloc() overflow"));
 
123
            errorx2(1, _("internal error, %s overflow"), "ecalloc()");
124
124
        size *= nmemb;
125
125
    }
126
126
    if ((ptr = malloc(size)) == NULL)
160
160
    if (nmemb == 0 || size == 0)
161
161
        errorx2(1, _("internal error, tried to erealloc3(0)"));
162
162
    if (nmemb > SIZE_MAX / size)
163
 
        errorx2(1, _("internal error, erealloc3() overflow"));
 
163
        errorx2(1, _("internal error, %s overflow"), "erealloc3()");
164
164
 
165
165
    size *= nmemb;
166
166
    ptr = ptr ? realloc(ptr, size) : malloc(size);
182
182
    size_t size;
183
183
 
184
184
    if (nmemb == 0 || msize == 0)
185
 
        errorx2(1, _("internal error, tried to erealloc3(0)"));
 
185
        errorx2(1, _("internal error, tried to erecalloc(0)"));
186
186
    if (nmemb > SIZE_MAX / msize)
187
 
        errorx2(1, _("internal error, erealloc3() overflow"));
 
187
        errorx2(1, _("internal error, %s overflow"), "erecalloc()");
188
188
 
189
189
    size = nmemb * msize;
190
190
    ptr = ptr ? realloc(ptr, size) : malloc(size);