Re: [PATCH] miscutils: fix potential integer overflow in gray level calculation in fbsplash.c

2025-02-05 Thread Kang-Che Sung
On Wed, Feb 5, 2025 at 6:36 AM Anton Moryakov wrote: > diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c > index 2934d8eb7..96644865e 100644 > --- a/miscutils/fbsplash.c > +++ b/miscutils/fbsplash.c > @@ -353,7 +353,7 @@ static void fb_drawprogressbar(unsigned percent) > whi

[PATCH] miscutils: fix DIVISION_BY_ZERO.EX in beep.c

2025-02-05 Thread Anton Moryakov
Report of the static analyzer: DIVISION_BY_ZERO.EX Variable xatou(...), whose possible value set allows a zero value at xatonum_template.c:118 by calling function 'xatou' at beep.c:90, is used as a denominator at beep.c:90. Corrections explained: - If xatou(optarg) returns 0, freq is set to 440

[PATCH] miscutils: fix DIVISION_BY_ZERO.EX in beep.c

2025-02-05 Thread Anton Moryakov
Report of the static analyzer: DIVISION_BY_ZERO.EX Variable xatou(...), whose possible value set allows a zero value at xatonum_template.c:118 by calling function 'xatou' at beep.c:90, is used as a denominator at beep.c:90. Corrections explained: - If xatou(optarg) returns 0, freq is set to 440

[PATCH] miscutils: fix DIVISION_BY_ZERO.EX in beep.c

2025-02-05 Thread Anton Moryakov
Report of the static analyzer: DIVISION_BY_ZERO.EX Variable xatou(...), whose possible value set allows a zero value at xatonum_template.c:118 by calling function 'xatou' at beep.c:90, is used as a denominator at beep.c:90. Corrections explained: - If xatou(optarg) returns 0, freq is set to 440

Re: [PATCH] miscutils: fix DIVISION_BY_ZERO.EX in beep.c

2025-02-05 Thread tito
On Wed, 5 Feb 2025 18:38:05 +0300 Anton Moryakov wrote: > Report of the static analyzer: > DIVISION_BY_ZERO.EX Variable xatou(...), > whose possible value set allows a zero value at xatonum_template.c:118 by > calling function 'xatou' at beep.c:90, > is used as a denominator at beep.c:90. > >

[PATCH] cut: Fix typo in help text

2025-02-05 Thread Christian Kohlschütter
Replace delimeter with delimiter Signed-off-by: Christian Kohlschütter --- coreutils/cut.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreutils/cut.c b/coreutils/cut.c index d81f36bcd..8ac1b9ca9 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -45,12 +45,12 @

[PATCH] cut: Fix typo in help text

2025-02-05 Thread Christian Kohlschütter
Replace delimeter with delimiter Signed-off-by: Christian Kohlschütter --- coreutils/cut.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreutils/cut.c b/coreutils/cut.c index d81f36bcd..8ac1b9ca9 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -45,12 +45,12 @@

[PATCH] libbb: fix handle errors and overflow in xmalloc_readlink in xreadlink.c

2025-02-05 Thread Anton Moryakov
report Possible integer overflow: left operand is tainted. An integer overflow may occur due to arithmetic operation (addition) between variable 'readsize' and value '1', when 'readsize' is tainted { [-2147483648, -2], [0, 2147483647] } Corrections explained: - Combined error and overflow chec

[PATCH] init: fix memory leak in finalize function in bootchartd.c

2025-02-05 Thread Anton Moryakov
report: Dynamic memory, referenced by 'return value of xasprintf(...)', is allocated at xfuncs_printf.c:344 by calling function 'xasprintf' at bootchartd.c:318 and lost at bootchartd.c:320. Corrections explained: - Fixed a memory leak caused by not freeing the result of `xasprintf`. - Added a va

Re: [PATCH] shell: fix DEREF_AFTER_NULL.EX.COND in hush.c

2025-02-05 Thread Harald van Dijk
On 06/02/2025 01:29, Anton Moryakov wrote: report After having been compared to a NULL value at `if (dest.data) {`, pointer 'dest.data' is passed in call to function 'o_addQchr' at `o_addQchr(&dest, ch);`, where it is dereferenced at ` && strchr("*?[-\\" MAYBE_BRACES, ch)` This looks like a le

[PATCH] shell: fix DEREF_AFTER_NULL.EX.COND in hush.c

2025-02-05 Thread Anton Moryakov
report After having been compared to a NULL value at `if (dest.data) {`, pointer 'dest.data' is passed in call to function 'o_addQchr' at `o_addQchr(&dest, ch);`, where it is dereferenced at ` && strchr("*?[-\\" MAYBE_BRACES, ch)` Corrections explained: Added a check before calling o_addQchr to

Re: [PATCH] libbb: fix handle errors and overflow in xmalloc_readlink in xreadlink.c

2025-02-05 Thread Harald van Dijk
On 06/02/2025 00:11, Anton Moryakov wrote: report Possible integer overflow: left operand is tainted. An integer overflow may occur due to arithmetic operation (addition) between variable 'readsize' and value '1', when 'readsize' is tainted { [-2147483648, -2], [0, 2147483647] } Corrections expl

[PATCH] scripts: kconfig: fix handle leak in conf_write in confdata.c

2025-02-05 Thread Anton Moryakov
report: HANDLE_LEAK The handle 'out' is created at `out = fopen(newname, "w");` by calling function 'fopen' and lost at `return 1;` Corrections explained: Added fclose(out) before returning from the function when out_h fails to open. This ensures that the file handle 'out' is properly closed, pre

Re: [PATCH] init: fix memory leak in finalize function in bootchartd.c

2025-02-05 Thread Harald van Dijk
On 06/02/2025 00:29, Anton Moryakov wrote: report: Dynamic memory, referenced by 'return value of xasprintf(...)', is allocated at xfuncs_printf.c:344 by calling function 'xasprintf' at bootchartd.c:318 and lost at bootchartd.c:320. This happens in finalize(), which is called just before the pr