-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk45t2EACgkQrlYvE4MpobM8IgCg3IocD3x0AUGyu2vHQ0maAr34 qX8An1DvMB4SoLQ+UliBXrq27a4VDWXy =oN93 -----END PGP SIGNATURE-----
>From 3617a5d67b08ab51763fa5da6f6e25abc77743b4 Mon Sep 17 00:00:00 2001 From: Eric Paris <eparis@xxxxxxxxxx> Date: Sun, 10 Jul 2011 17:38:43 +0200 Subject: [PATCH 043/155] policycoreutils: make process_one error if not initialized correctly Rather than blow up in horible ways, error out if we detect initialization wasn't done properly. Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- policycoreutils/setfiles/restore.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/policycoreutils/setfiles/restore.c b/policycoreutils/setfiles/restore.c index 1a8882c..f4e31a3 100644 --- a/policycoreutils/setfiles/restore.c +++ b/policycoreutils/setfiles/restore.c @@ -300,8 +300,14 @@ static int process_one(char *name, int recurse_this_path) int rc = 0; const char *namelist[2] = {name, NULL}; dev_t dev_num = 0; - FTS *fts_handle; - FTSENT *ftsent; + FTS *fts_handle = NULL; + FTSENT *ftsent = NULL; + + if (r_opts == NULL){ + fprintf(stderr, + "Must call initialize first!"); + goto err; + } fts_handle = fts_open((char **)namelist, r_opts->fts_flags, NULL); if (fts_handle == NULL) { -- 1.7.6
Attachment:
0043-policycoreutils-make-process_one-error-if-not-initia.patch.sig
Description: PGP signature