need to be translated.
if (nmemb == 0 || size == 0)
errorx2(1, _("internal error, tried to emalloc2(0)"));
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, emalloc2() overflow"));
+ errorx2(1, _("internal error, %s overflow"), "emalloc2()");
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
errorx2(1, _("internal error, tried to ecalloc(0)"));
if (nmemb != 1) {
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, ecalloc() overflow"));
+ errorx2(1, _("internal error, %s overflow"), "ecalloc()");
size *= nmemb;
}
if ((ptr = malloc(size)) == NULL)
if (nmemb == 0 || size == 0)
errorx2(1, _("internal error, tried to erealloc3(0)"));
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, erealloc3() overflow"));
+ errorx2(1, _("internal error, %s overflow"), "erealloc3()");
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
size_t size;
if (nmemb == 0 || msize == 0)
- errorx2(1, _("internal error, tried to erealloc3(0)"));
+ errorx2(1, _("internal error, tried to erecalloc(0)"));
if (nmemb > SIZE_MAX / msize)
- errorx2(1, _("internal error, erealloc3() overflow"));
+ errorx2(1, _("internal error, %s overflow"), "erecalloc()");
size = nmemb * msize;
ptr = ptr ? realloc(ptr, size) : malloc(size);
oflow:
/* We pre-allocate enough space, so this should never happen. */
- errorx(1, _("internal error, expand_prompt() overflow"));
+ errorx(1, _("internal error, %s overflow"), "expand_prompt()");
}
/*
char **nenvp;
size_t nsize;
- if (env.env_size > SIZE_MAX - 128)
- errorx2(1, _("internal error, sudo_putenv_nodebug() overflow"));
+ if (env.env_size > SIZE_MAX - 128) {
+ errorx2(1, _("internal error, %s overflow"),
+ "sudo_putenv_nodebug()");
+ }
nsize = env.env_size + 128;
- if (nsize > SIZE_MAX / sizeof(char *))
- errorx2(1, _("internal error, sudo_putenv_nodebug() overflow"));
+ if (nsize > SIZE_MAX / sizeof(char *)) {
+ errorx2(1, _("internal error, %s overflow"),
+ "sudo_putenv_nodebug()");
+ }
nenvp = realloc(env.envp, nsize * sizeof(char *));
if (nenvp == NULL) {
errno = ENOMEM;
strlcat(estring, "=", esize) >= esize ||
strlcat(estring, val, esize) >= esize) {
- errorx(1, _("internal error, sudo_setenv2() overflow"));
+ errorx(1, _("internal error, %s overflow"), "sudo_setenv2()");
}
rval = sudo_putenv(estring, dupcheck, overwrite);
if (rval == -1)
rval = sudo_setenv_nodebug(var, val, overwrite);
if (rval == -1) {
if (errno == EINVAL)
- errorx(1, _("internal error, sudo_setenv() overflow"));
+ errorx(1, _("internal error, %s overflow"), "sudo_setenv()");
errorx(1, _("unable to allocate memory"));
}
debug_return_int(rval);
command = cp = emalloc(size);
for (av = argv; *av != NULL; av++) {
n = strlcpy(cp, *av, size - (cp - command));
- if (n >= size - (cp - command))
- errorx(1, _("internal error, linux_audit_command() overflow"));
+ if (n >= size - (cp - command)) {
+ errorx(1, _("internal error, %s overflow"),
+ "linux_audit_command()");
+ }
cp += n;
*cp++ = ' ';
}
(unsigned int)runas_pw->pw_gid;
len = snprintf(cp, glsize - (cp - gid_list), "%u", egid);
if (len < 0 || len >= glsize - (cp - gid_list))
- errorx(1, _("internal error, runas_groups overflow"));
+ errorx(1, _("internal error, %s overflow"), "runas_groups");
cp += len;
for (i = 0; i < grlist->ngids; i++) {
if (grlist->gids[i] != egid) {
len = snprintf(cp, glsize - (cp - gid_list), ",%u",
(unsigned int) grlist->gids[i]);
if (len < 0 || len >= glsize - (cp - gid_list))
- errorx(1, _("internal error, runas_groups overflow"));
+ errorx(1, _("internal error, %s overflow"), "runas_groups");
cp += len;
}
}
for (to = user_args, av = NewArgv + 1; *av; av++) {
n = strlcpy(to, *av, size - (to - user_args));
if (n >= size - (to - user_args))
- errorx(1, _("internal error, set_cmnd() overflow"));
+ errorx(1, _("internal error, %s overflow"), "set_cmnd()");
to += n;
*to++ = ' ';
}
for (to = user_args, from = argv; *from; from++) {
n = strlcpy(to, *from, size - (to - user_args));
if (n >= size - (to - user_args))
- errorx(1, _("internal error, init_vars() overflow"));
+ errorx(1, _("internal error, %s overflow"), "init_vars()");
to += n;
*to++ = ' ';
}