The following issues were found
tests/basics/bytes_find.py
1 issues
Line: 1
Column: 1
print(b"hello world".find(b"ll"))
print(b"hello world".find(b"ll", None))
print(b"hello world".find(b"ll", 1))
print(b"hello world".find(b"ll", 1, None))
print(b"hello world".find(b"ll", None, None))
print(b"hello world".find(b"ll", 1, -1))
print(b"hello world".find(b"ll", 1, 1))
print(b"hello world".find(b"ll", 1, 2))
print(b"hello world".find(b"ll", 1, 3))
Reported by Pylint.
tests/float/builtin_float_pow.py
1 issues
Line: 1
Column: 1
# test builtin pow function with float args
print(pow(0.0, 0.0))
print(pow(0, 1.0))
print(pow(1.0, 1))
print(pow(2.0, 3.0))
print(pow(2.0, -4.0))
print(pow(0.0, float("inf")))
Reported by Pylint.
tests/float/builtin_float_round_intbig.py
1 issues
Line: 1
Column: 1
# test round() with floats that return large integers
for x in (-1e25, 1e25):
print("%.3g" % round(x))
Reported by Pylint.
ports/stm32/usbhost/Core/Src/usbh_core.c
1 issues
Line: 279
CWE codes:
476
pif = (USBH_InterfaceDescTypeDef *)0;
pcfg = &phost->device.CfgDesc;
if((pif->bInterfaceClass == 0xFF) &&(pif->bInterfaceSubClass == 0xFF) && (pif->bInterfaceProtocol == 0xFF))
{
return 0xFF;
}
while (if_ix < USBH_MAX_NUM_INTERFACES)
Reported by Cppcheck.
tests/basics/string_rindex.py
1 issues
Line: 1
Column: 1
print("hello world".rindex("ll"))
print("hello world".rindex("ll", None))
print("hello world".rindex("ll", 1))
print("hello world".rindex("ll", 1, None))
print("hello world".rindex("ll", None, None))
print("hello world".rindex("ll", 1, -1))
try:
print("hello world".rindex("ll", 1, 1))
Reported by Pylint.
tests/basics/string_rfind.py
1 issues
Line: 1
Column: 1
print("hello world".rfind("ll"))
print("hello world".rfind("ll", None))
print("hello world".rfind("ll", 1))
print("hello world".rfind("ll", 1, None))
print("hello world".rfind("ll", None, None))
print("hello world".rfind("ll", 1, -1))
print("hello world".rfind("ll", 1, 1))
print("hello world".rfind("ll", 1, 2))
print("hello world".rfind("ll", 1, 3))
Reported by Pylint.
tests/basics/string_repr.py
1 issues
Line: 1
Column: 1
# anything above 0xa0 is printed as Unicode by CPython
# the abobe is CPython implementation detail, stick to ASCII
for c in range(0x80):
print("0x{:02x}: {}".format(c, repr(chr(c))))
Reported by Pylint.
ports/stm32/rfcore.c
1 issues
Line: 465
CWE codes:
476
cmd[9] = opcode;
cmd[10] = opcode >> 8;
cmd[11] = len;
memcpy(&cmd[12], buf, len);
#if HCI_TRACE
printf("[% 8d] >HCI(", mp_hal_ticks_ms());
for (int i = 0; i < len + 4; ++i) {
printf(":%02x", cmd[i + 8]);
Reported by Cppcheck.
ports/stm32/mpbthciport.c
1 issues
Line: 155
int mp_bluetooth_hci_uart_write(const uint8_t *buf, size_t len) {
MICROPY_PY_BLUETOOTH_ENTER
rfcore_ble_hci_cmd(len, (const uint8_t *)buf);
MICROPY_PY_BLUETOOTH_EXIT
return 0;
}
// Callback to copy data into local hci_uart_rx_buf_data buffer for subsequent use.
STATIC int mp_bluetooth_hci_uart_msg_cb(void *env, const uint8_t *buf, size_t len) {
Reported by Cppcheck.
ports/stm32/main.c
1 issues
Line: 490
CWE codes:
570
// to recover from limit hit. (Limit is measured in bytes.)
// Note: stack control relies on main thread being initialised above
mp_stack_set_top(&_estack);
mp_stack_set_limit((char *)&_estack - (char *)&_sstack - 1024);
// GC init
gc_init(MICROPY_HEAP_START, MICROPY_HEAP_END);
#if MICROPY_ENABLE_PYSTACK
Reported by Cppcheck.