Change some fatalx(NULL) that should be fatal(NULL).

This commit is contained in:
Todd C. Miller
2013-08-15 13:06:49 -06:00
parent 4928c8c72e
commit 85fc5792d4
5 changed files with 16 additions and 16 deletions

View File

@@ -82,7 +82,7 @@ emalloc(size_t size)
fatalx_nodebug(_("internal error, tried to emalloc(0)")); fatalx_nodebug(_("internal error, tried to emalloc(0)"));
if ((ptr = malloc(size)) == NULL) if ((ptr = malloc(size)) == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return ptr; return ptr;
} }
@@ -102,7 +102,7 @@ emalloc2(size_t nmemb, size_t size)
size *= nmemb; size *= nmemb;
if ((ptr = malloc(size)) == NULL) if ((ptr = malloc(size)) == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return ptr; return ptr;
} }
@@ -124,7 +124,7 @@ ecalloc(size_t nmemb, size_t size)
size *= nmemb; size *= nmemb;
} }
if ((ptr = malloc(size)) == NULL) if ((ptr = malloc(size)) == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
memset(ptr, 0, size); memset(ptr, 0, size);
return ptr; return ptr;
} }
@@ -143,7 +143,7 @@ erealloc(void *ptr, size_t size)
ptr = ptr ? realloc(ptr, size) : malloc(size); ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL) if (ptr == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return ptr; return ptr;
} }
@@ -165,7 +165,7 @@ erealloc3(void *ptr, size_t nmemb, size_t size)
size *= nmemb; size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size); ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL) if (ptr == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return ptr; return ptr;
} }
@@ -189,7 +189,7 @@ erecalloc(void *ptr, size_t onmemb, size_t nmemb, size_t msize)
size = nmemb * msize; size = nmemb * msize;
ptr = ptr ? realloc(ptr, size) : malloc(size); ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL) if (ptr == NULL)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
if (nmemb > onmemb) { if (nmemb > onmemb) {
size = (nmemb - onmemb) * msize; size = (nmemb - onmemb) * msize;
memset((char *)ptr + (onmemb * msize), 0, size); memset((char *)ptr + (onmemb * msize), 0, size);
@@ -254,7 +254,7 @@ easprintf(char **ret, const char *fmt, ...)
va_end(ap); va_end(ap);
if (len == -1) if (len == -1)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return len; return len;
} }
@@ -268,6 +268,6 @@ evasprintf(char **ret, const char *format, va_list args)
int len; int len;
if ((len = vasprintf(ret, format, args)) == -1) if ((len = vasprintf(ret, format, args)) == -1)
fatalx_nodebug(NULL); fatal_nodebug(NULL);
return len; return len;
} }

View File

@@ -366,7 +366,7 @@ sudo_putenv(char *str, bool dupcheck, bool overwrite)
if (env.envp[env.env_len] != NULL) if (env.envp[env.env_len] != NULL)
fatalx(_("sudo_putenv: corrupted envp, length mismatch")); fatalx(_("sudo_putenv: corrupted envp, length mismatch"));
#endif #endif
fatalx(NULL); fatal(NULL);
} }
debug_return_int(rval); debug_return_int(rval);
} }

View File

@@ -109,7 +109,7 @@ disable_execute(char *const envp[])
preload = fmt_string(RTLD_PRELOAD_VAR, sudo_conf_noexec_path()); preload = fmt_string(RTLD_PRELOAD_VAR, sudo_conf_noexec_path());
# endif # endif
if (preload == NULL) if (preload == NULL)
fatalx(NULL); fatal(NULL);
nenvp[env_len++] = preload; nenvp[env_len++] = preload;
nenvp[env_len] = NULL; nenvp[env_len] = NULL;
} else { } else {

View File

@@ -503,7 +503,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp,
settings[j] = fmt_string(sudo_settings[i].name, settings[j] = fmt_string(sudo_settings[i].name,
sudo_settings[i].value); sudo_settings[i].value);
if (settings[j] == NULL) if (settings[j] == NULL)
fatalx(NULL); fatal(NULL);
j++; j++;
} }
} }

View File

@@ -467,7 +467,7 @@ get_user_info(struct user_details *ud)
user_info[i] = fmt_string("user", pw->pw_name); user_info[i] = fmt_string("user", pw->pw_name);
if (user_info[i] == NULL) if (user_info[i] == NULL)
fatalx(NULL); fatal(NULL);
ud->username = user_info[i] + sizeof("user=") - 1; ud->username = user_info[i] + sizeof("user=") - 1;
/* Stash user's shell for use with the -s flag; don't pass to plugin. */ /* Stash user's shell for use with the -s flag; don't pass to plugin. */
@@ -493,14 +493,14 @@ get_user_info(struct user_details *ud)
if (getcwd(cwd, sizeof(cwd)) != NULL) { if (getcwd(cwd, sizeof(cwd)) != NULL) {
user_info[++i] = fmt_string("cwd", cwd); user_info[++i] = fmt_string("cwd", cwd);
if (user_info[i] == NULL) if (user_info[i] == NULL)
fatalx(NULL); fatal(NULL);
ud->cwd = user_info[i] + sizeof("cwd=") - 1; ud->cwd = user_info[i] + sizeof("cwd=") - 1;
} }
if ((cp = get_process_ttyname()) != NULL) { if ((cp = get_process_ttyname()) != NULL) {
user_info[++i] = fmt_string("tty", cp); user_info[++i] = fmt_string("tty", cp);
if (user_info[i] == NULL) if (user_info[i] == NULL)
fatalx(NULL); fatal(NULL);
ud->tty = user_info[i] + sizeof("tty=") - 1; ud->tty = user_info[i] + sizeof("tty=") - 1;
efree(cp); efree(cp);
} }
@@ -511,7 +511,7 @@ get_user_info(struct user_details *ud)
strlcpy(host, "localhost", sizeof(host)); strlcpy(host, "localhost", sizeof(host));
user_info[++i] = fmt_string("host", host); user_info[++i] = fmt_string("host", host);
if (user_info[i] == NULL) if (user_info[i] == NULL)
fatalx(NULL); fatal(NULL);
ud->host = user_info[i] + sizeof("host=") - 1; ud->host = user_info[i] + sizeof("host=") - 1;
get_ttysize(&ud->ts_lines, &ud->ts_cols); get_ttysize(&ud->ts_lines, &ud->ts_cols);
@@ -739,7 +739,7 @@ command_info_to_details(char * const info[], struct command_details *details)
#endif #endif
details->pw = getpwuid(details->euid); details->pw = getpwuid(details->euid);
if (details->pw != NULL && (details->pw = pw_dup(details->pw)) == NULL) if (details->pw != NULL && (details->pw = pw_dup(details->pw)) == NULL)
fatalx(NULL); fatal(NULL);
#ifdef HAVE_SETAUTHDB #ifdef HAVE_SETAUTHDB
aix_restoreauthdb(); aix_restoreauthdb();
#endif #endif