ubiupdatevol: Prevent null pointer dereference
PATCH 1/1 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 <[email protected]>
--- ubi-utils/ubiupdatevol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
ubi-utils/ubiupdatevol.c +1 -3
@@ -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);
Signature · 6 lines
2.23.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
David Oberhollenzer
AppliedApplied to mtd-utils.git master.
Thanks,
David
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/