rstephan / ArtnetWifi

Arduino library for Art-Net (artnet) over WiFi, send and receive DMX data. Runs on ESP8266, ESP32, Pi Pico W, WiFi101 and WiFiNINA devices.
Other
353 stars 59 forks source link

Initialize artDmxCallback as NULL #50

Closed niliha closed 1 year ago

niliha commented 1 year ago

When not explicitly setting artDmxCallback via setArtDmxCallback(), it may point to an invalid address other than NULL, since primitive pointers are not initialized by the compiler in c++.

Since read() tries to dereference artDmxCallback if it's not NULL, the program may crash.

As an easy fix, I suggest to initialize artDmxCallback as NULL in the initializer list.

rstephan commented 1 year ago

That is a very good idea! Thanks.