Re: [PATCH] lib: add NULL pointer check for %s format

2025-05-19 Thread Anton Moryakov
ed subject prefix to reflect the correct subsystem (tiny-printf), - Simplified and clarified the commit message as per your suggestions, - No code changes — just improved presentation. Thanks again for the helpful review! Best regards, Anton Moryakov пн, 19 мая 2025 г. в 22:11, Tom Rini : > O

Re: [PATCH] tools: fix handle leak in ifdtool.c

2025-05-19 Thread Anton Moryakov
Maybe. However, the static analyser did not swear at others Пн, 19 мая 2025 г. в 11:47, Quentin Schulz : > Hi Anton, > > On 5/16/25 5:25 PM, ant.v.morya...@gmail.com wrote: > > From: Anton Moryakov > > > > Prevent file descriptor leaks by properly closing 'fd&#

Re: [PATCH] drivers: usb: host: fix prevent memory leak in interrupt message submission

2025-05-16 Thread Anton Moryakov
Hi Fabio, Thanks for the review. Yes, this is v2 — the issue Tom pointed out (unreachable `goto` after `return`) was fixed by replacing it with `result = -EINVAL; goto err;`. In v3 I’ve now removed the leftover comment. No other functional changes. Best regards, Anton пт, 16 мая 2025 г. в 22:59

Re: [PATCH] drivers: usb: host: fix prevent memory leak in interrupt message submission

2025-05-16 Thread Anton Moryakov
Thanks Tom — you're right, that `goto` after `return` is unreachable. I'll fix that and resend with the corrected flow. пт, 16 мая 2025 г. в 21:31, Tom Rini : > On Fri, May 16, 2025 at 08:54:34PM +0300, ant.v.morya...@gmail.com wrote: > > > From: Anton Moryakov >

Re: [PATCH] drivers: spi: fix deref ater null.might in spi-uclass.c

2025-05-16 Thread Anton Moryakov
I can then leave only + if (!dev) { + ret = -ENODEV; + goto err; + } + but make it higher How do you like this option? пт, 16 мая 2025 г. в 19:20, Simon Glass : > Hi, > > On Fri, 16 May 2025 at 14:51, wrote: > > > > From: Anton

[PATCH] lib: rsa: add NULL check for 'algo' in

2025-02-25 Thread Anton Moryakov
- Check return value of fdt_getprop for NULL. - Return -EFAULT if 'algo' property is missing. - Prevent NULL pointer dereference in strcmp." Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- lib/rsa/rsa-verify.c | 5 + 1 file changed, 5 insertions(+

[PATCH] lib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data

2025-02-25 Thread Anton Moryakov
- Ensure `free_ctx` is called in both error and success paths. - Fix memory leak in `ctx.signature` when `do_add` fails." Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- lib/ecdsa/ecdsa-libcrypto.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)

[PATCH] common: fix: add NULL checks for xrealloc in make_string

2025-02-06 Thread Anton Moryakov
- Check return value of xrealloc for NULL. - Free allocated memory and return NULL if xrealloc fails. - Prevent NULL pointer dereference in strlen and strcat. Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- common/cli_hush.c | 8 +++- 1 file changed, 7

[PATCH] common: fix: add NULL checks for malloc_cache_aligned in

2025-02-06 Thread Anton Moryakov
- Check return value of malloc_cache_aligned for presskey and sha. - Return -ENOMEM if memory allocation fails. - Free allocated memory in error paths." Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- common/autoboot.c | 5 + 1 file changed, 5 inser

[PATCH] lib: ecdsa: fix prevent memory leak in ecdsa_add_verify_data

2025-02-06 Thread Anton Moryakov
- Ensure `free_ctx` is called in both error and success paths. - Fix memory leak in `ctx.signature` when `do_add` fails." Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- lib/ecdsa/ecdsa-libcrypto.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)

[PATCH] tools: fix NULL_AFTER_DEREF in image-host.c

2025-01-30 Thread Anton Moryakov
LL if memory allocation fails. This also needs to be checked. 3. Checking the result of realloc: If realloc returns NULL, then memory has not been allocated and dup must be freed to avoid memory leaks. Triggers found by static analyzer Svace. Signed-off-by: Anton Moryakov --- tools/image-host