diff options
author | Lucian Cojocar <cojocar@chromium.org> | 2012-07-30 15:21:49 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-31 12:34:11 -0700 |
commit | 2312ab612299ee8b4a104dc121d6ab4fc65a9d13 (patch) | |
tree | 099f3ce68b23ec2b28c5c6b08f399b01a0767507 /utility | |
parent | 82bb80262e87d253731251f829471005e0b9d8e7 (diff) | |
download | vboot-2312ab612299ee8b4a104dc121d6ab4fc65a9d13.tar.gz |
vbutil_kernel: gracefully exit if the config file is bad
If the config file is specified in the parameter list but we aren't able
to open (or read) the file, vbutil_kernel should return an error instead
of crashing with a Segmentation Fault.
BUG=chromium-os:33087
TEST=manual
Invoke vbutil_kernel with a bogus path for the config file (--config).
Change-Id: I32dab7c381b9094f4015a554bc59989f1bb329ef
Signed-off-by: Lucian Cojocar <cojocar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28740
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'utility')
-rw-r--r-- | utility/vbutil_kernel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utility/vbutil_kernel.c b/utility/vbutil_kernel.c index 29d508a0..586ad77a 100644 --- a/utility/vbutil_kernel.c +++ b/utility/vbutil_kernel.c @@ -839,6 +839,8 @@ int main(int argc, char* argv[]) { if (config_file) { Debug("Reading %s\n", config_file); g_config_data = ReadConfigFile(config_file, &g_config_size); + if (!g_config_data) + Fatal("Error reading config file.\n"); } if (vmlinuz_file) @@ -900,6 +902,8 @@ int main(int argc, char* argv[]) { free(g_config_data); Debug("Reading %s\n", config_file); g_config_data = ReadConfigFile(config_file, &g_config_size); + if (!g_config_data) + Fatal("Error reading config file.\n"); } if (keyblock_file) { |