[PATCH] tools: fdtgrep: Fix handle leak

2022-11-23 Thread Mikhail Ilin
: 1043d0a0296a ("fdt: Add fdtgrep tool") Signed-off-by: Mikhail Ilin --- tools/fdtgrep.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/fdtgrep.c b/tools/fdtgrep.c index 641d6a2e3e..7eabcab439 100644 --- a/tools/fdtgrep.c +++ b/tools/fdtgr

[PATCH] tools: imx8image: Fix handle leak

2022-11-23 Thread Mikhail Ilin
8X image support") Signed-off-by: Mikhail Ilin --- tools/imx8image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/imx8image.c b/tools/imx8image.c index 01e1486911..395d5c64bd 100644 --- a/tools/imx8image.c +++ b/tools/imx8image.c @@ -279,6 +279,7 @@ static uint32_t parse_cfg_f

[PATCH] tools: imx8mimage: Fix handle leak

2022-11-23 Thread Mikhail Ilin
The handle "fd" was created in imx8mimage.c:178 by calling the "fopen" function and is lost in imx8mimage.c:210. Should close the 'fd' file descriptor before exiting the parse_cfg_file(char *name) function. Fixes: 6609c2663c9c ("tools: add i.MX8M image support"

[PATCH v3] tools: mkimage: Fix nullptr at strchr()

2022-11-23 Thread Mikhail Ilin
The copy_datafile(ifd, params.datafile) function has been implemented to copy data by reducing the number of lines in the main function. Signed-off-by: Mikhail Ilin --- tools/mkimage.c | 35 +++--- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git

[PATCH] fs: ext4: Fix dereferencing the null pointer 'ptr'

2022-11-23 Thread Mikhail Ilin
t;) Signed-off-by: Mikhail Ilin --- fs/ext4/ext4_common.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 1185cb2c04..3cdd1a04a9 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -851,10 +851,12 @@

[PATCH v2] tools: mkimage: Fix nullptr at strchr()

2022-11-22 Thread Mikhail Ilin
The 'file' pointer can be null. Thus, before using it in the strchr() function, you need to make sure that it is not null. Fixes: d1be8f922eb3 ("mkimage: Fix variable length header support") Signed-off-by: Mikhail Ilin --- tools/mkimage.c | 2 ++ 1 file changed, 2 insertions(+)

[PATCH] tools: imximage: Fix check array index

2022-11-22 Thread Mikhail Ilin
ary to tighten the check on the 'size' variable on line 463. Fixes: 0b0c6af38738 ("Prepare v2020.01") Signed-off-by: Mikhail Ilin --- tools/imximage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/imximage.c b/tools/imximage.c index d7edd3c52f..8d45

[PATCH] tools: mkimage: Fix nullptr at strchr() The 'file' pointer can be null. Thus, before using it in the strchr() function, you need to make sure that it is not null.

2022-11-22 Thread Mikhail Ilin
Fixes: 0b0c6af38738 ("Prepare v2020.01") Signed-off-by: Mikhail Ilin --- tools/mkimage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mkimage.c b/tools/mkimage.c index 5f51d2cc89..95005d8414 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -509,6 +509,8 @@ int mai

[PATCH] fs: ext4: Fix free(NULL) The 'depth_dirname', 'ptr', 'parent_inode' and 'first_inode' pointers may be null. Thus, it is necessary to check them before using free() to avoid free(NULL) cases.

2022-11-22 Thread Mikhail Ilin
Fixes: 934b14f2bb30 ("ext4: free allocations by parse_path()") Signed-off-by: Mikhail Ilin --- fs/ext4/ext4_common.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 5bf78b530a..422497c

[PATCH] efi_loader: Fix buffer underflow If the array index 'i' < 128, the 'codepage' array is accessed using [-128...-1] in efi_unicode_collation.c:262. This can lead to a buffer overflow. Negative i

2022-11-21 Thread Mikhail Ilin
Fixes: 0bc4b0da7b59 ("efi_loader: EFI_UNICODE_COLLATION_PROTOCOL") Signed-off-by: Mikhail Ilin --- lib/efi_loader/efi_unicode_collation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collati

[PATCH] tool: ifwitool: Fix buffer overflow

2022-11-18 Thread Mikhail Ilin
, an 'offset' is made, relative to the 1st argument, which itself is an 'offset' from the beginning of the structure. Signed-off-by: Mikhail Ilin --- tools/ifwitool.c | 44 +++- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/tools/ifwitool.c b

[PATCH v2020.01] tool: ifwitool: The function localtime() can return NULL.

2022-11-18 Thread Mikhail Ilin
. Signed-off-by: Mikhail Ilin --- tools/ifwitool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ifwitool.c b/tools/ifwitool.c index 543e9d4e70..b9873deb6b 100644 --- a/tools/ifwitool.c +++ b/tools/ifwitool.c @@ -1630,6 +1630,8 @@ static void init_manifest_header(struct manifest_header