|
From: openocd-gerrit <ope...@us...> - 2026-04-06 16:22:58
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via b215fe8621890e624a4bc0c56ccb4f9340009144 (commit)
via 92dc88978ada47764c7c4b093702952c92bd7484 (commit)
from 4e23bf155f8e132f90720dfdcca77835934efddb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b215fe8621890e624a4bc0c56ccb4f9340009144
Author: Mark O'Donovan <sh...@po...>
Date: Tue Feb 24 22:14:04 2026 +0000
jtag/drivers/presto: fix potential divide by 0
Found by cppcheck.
Change-Id: I656685eb3b639dc054c3a563203264e03d72d1c7
Signed-off-by: Mark O'Donovan <sh...@po...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9498
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c
index 84b881cdc..552c74c9c 100644
--- a/src/jtag/drivers/presto.c
+++ b/src/jtag/drivers/presto.c
@@ -451,7 +451,7 @@ static struct bitq_interface presto_bitq = {
static int presto_adapter_khz(int khz, int *jtag_speed)
{
- if (khz < 0) {
+ if (khz <= 0) {
*jtag_speed = 0;
return ERROR_COMMAND_SYNTAX_ERROR;
}
commit 92dc88978ada47764c7c4b093702952c92bd7484
Author: Mark O'Donovan <sh...@po...>
Date: Mon Mar 9 21:48:16 2026 +0000
flash/nor/str7x: fix undefined behaviour
Shifting 32 bit signed variables by 31 bits is undefined behaviour
Change-Id: Iec61a98eecd6657ff6ba1dcad6fff76052c917e3
Signed-off-by: Mark O'Donovan <sh...@po...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9497
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c
index 0177095cb..e84721333 100644
--- a/src/flash/nor/str7x.c
+++ b/src/flash/nor/str7x.c
@@ -736,7 +736,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
target_read_u32(target, str7x_get_flash_adr(bank, FLASH_NVAPR1), ®);
protection_regs = ~(reg >> 16);
- while (((protection_regs) != 0) && (protection_level < 16)) {
+ while ((protection_regs != 0) && (protection_level < 16)) {
protection_regs >>= 1;
protection_level++;
}
@@ -753,7 +753,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command)
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd);
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_AR), 0x4010DFBC);
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_DR0),
- ~(1 << (15 + protection_level)));
+ ~(1U << (15 + protection_level)));
flash_cmd = FLASH_SPR | FLASH_WMS;
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd);
}
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/str7x.c | 4 ++--
src/jtag/drivers/presto.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|