-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
drivers/mtd: Add check for integer overflow #20587
Conversation
@@ -16,6 +16,7 @@ | |||
static int _init(mtd_dev_t *dev) | |||
{ | |||
mtd_emulated_t *mtd = (mtd_emulated_t *)dev; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated change, sneaking it in to make the file happy in uncrustify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, thanks for the cleanup
Untested ack from my side
Switched from the unsigned buildins to the "you will figure the type out" buildins. |
This means it got larger than what would fit into 16 bit address space, so it needs to be added to Btw.: I get this a lot with the But anyway, bumping |
Thanks for looking into it Maribu. I add (via script) the ah maybe I should have put it in an different commit. |
Contribution description
Hei 🦫
Fixes a minor potential for integer overflow.
Testing procedure
CI / good review
Maybe
make -C tests/unittests tests-mtd test