diff options
| author | Rui Paulo <rpaulo@FreeBSD.org> | 2015-02-10 18:35:46 +0000 |
|---|---|---|
| committer | Rui Paulo <rpaulo@FreeBSD.org> | 2015-02-10 18:35:46 +0000 |
| commit | 624157bb5e20b588293257a67b60e9dbcf716653 (patch) | |
| tree | 2a68e501bd32626d33131833a52e357e7dfaf45b /sys/kern | |
| parent | 09cfaa45eb0fa65e8cbb6568194f04643f5b7ce5 (diff) | |
Notes
Diffstat (limited to 'sys/kern')
| -rw-r--r-- | sys/kern/kern_sig.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 655866d8cee2..6abe733c3234 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3225,14 +3225,13 @@ out: static int coredump_sanitise_path(const char *path) { - size_t len, i; + size_t i; /* * Only send a subset of ASCII to devd(8) because it * might pass these strings to sh -c. */ - len = strlen(path); - for (i = 0; i < len; i++) + for (i = 0; path[i]; i++) if (!(isalpha(path[i]) || isdigit(path[i])) && path[i] != '/' && path[i] != '.' && path[i] != '-') @@ -3365,10 +3364,8 @@ close: snprintf(data, sizeof(data), "comm=%s ", fullpath); free(freepath, M_TEMP); freepath = NULL; - if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) { - printf("could not find coredump\n"); + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) goto out; - } if (!coredump_sanitise_path(fullpath)) goto out; strlcat(data, "core=", sizeof(data)); |
