summaryrefslogtreecommitdiffstats
path: root/libsparse
diff options
context:
space:
mode:
authorHong-Mei Li <a21834@motorola.com>2013-04-01 11:22:50 +0800
committerHong-Mei Li <a21834@motorola.com>2013-04-01 11:22:50 +0800
commit83a6d36d4226f82c202ffb27f89e080f95b71c30 (patch)
tree39d81591491497545bb2c9fa2f3dc65dd5faa987 /libsparse
parentf5562cb66c1c15d65bc372ede4c180430e1ce9d7 (diff)
downloadcore-83a6d36d4226f82c202ffb27f89e080f95b71c30.tar.gz
core-83a6d36d4226f82c202ffb27f89e080f95b71c30.tar.bz2
core-83a6d36d4226f82c202ffb27f89e080f95b71c30.zip
libsparse: Fix null pointer issue
Fix the issue that "out" pointer is dereferenced without checking. Change-Id: I76a57ad7309841218231346f4807ef2be8628737 Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/output_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsparse/output_file.c b/libsparse/output_file.c
index b5ae4191f..5014e4a87 100644
--- a/libsparse/output_file.c
+++ b/libsparse/output_file.c
@@ -675,6 +675,9 @@ struct output_file *output_file_open_fd(int fd, unsigned int block_size, int64_t
} else {
out = output_file_new_normal();
}
+ if (!out) {
+ return NULL;
+ }
out->ops->open(out, fd);