espressif / esp-who

Face detection and recognition framework
Other
1.67k stars 466 forks source link

Missing null check in index_handler() #102

Closed bkeevil closed 5 years ago

bkeevil commented 5 years ago

This code causes a Guru Meditation Error in the event that esp_camera_sensor_get() returns null.

    sensor_t * s = esp_camera_sensor_get();
    if (s->id.PID == OV3660_PID) {

This is a common error that can occur if you select the wrong camera in make menuconfig

At minimum there should be a call to ESP_LOGE() and a graceful exit. Better would be to also return an HTTP 500 status message.

bkeevil commented 5 years ago

Closed with #103