summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastian Germann <bastiangermann@fishpost.de>2019-09-08 21:59:22 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-10 10:16:51 +0200
commit3fd38416e7a4817d18173cdebd5b4c5d62c06220 (patch)
tree635322a1656fe8903e45711e95907b052a680c26
parent1178a63f830dab71c6074b7c98e4d57946982656 (diff)
ubiupdatevol: Prevent null pointer dereference
libubi_close(libubi) is called in the error handler if libubi is null. Prevent that by handling the error case similar to the other ubi executables. Signed-off-by: Bastian Germann <bastiangermann@fishpost.de> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--ubi-utils/ubiupdatevol.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ubi-utils/ubiupdatevol.c b/ubi-utils/ubiupdatevol.c
index bdcc091..1b3239e 100644
--- a/ubi-utils/ubiupdatevol.c
+++ b/ubi-utils/ubiupdatevol.c
@@ -308,9 +308,7 @@ int main(int argc, char * const argv[])
if (!libubi) {
if (errno == 0)
errmsg("UBI is not present in the system");
- else
- sys_errmsg("cannot open libubi");
- goto out_libubi;
+ return sys_errmsg("cannot open libubi");
}
err = ubi_probe_node(libubi, args.node);