Skip to content

esp32/machine_sdcard.c: Invalid pin numbers are allowed. #8112

@IhorNehrutsa

Description

@IhorNehrutsa

STATIC gpio_num_t pin_or_int(const mp_obj_t arg) {
if (mp_obj_is_small_int(arg)) {
return MP_OBJ_SMALL_INT_VALUE(arg);
} else {
// This raises a value error if the argument is not a Pin.
return machine_pin_get_id(arg);
}
}

@nickovs

This function does not check int value.

    return MP_OBJ_SMALL_INT_VALUE(arg);

may return invalid pin numbers like 12345

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy