-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Open
Labels
py-coreRelates to py/ directory in sourceRelates to py/ directory in source
Description
I came across a problem while experimenting with MicroPython (v1.9.4). The program crashed while trying to execute this while
loop:
while (--d >= dig) {
a = (a << DIG_SIZE) | *d;
*d = a / base;
a %= base;
}
The pre-decrement (i.e. --
) operation underflows the d
pointer which caused the d >= dig
condition to succeed (even though it shouldn't). Therefore, the line
*d = a / base
was mistakenly executed using an out-of-bounds pointer d
.
Metadata
Metadata
Assignees
Labels
py-coreRelates to py/ directory in sourceRelates to py/ directory in source