Fixed some potentially unsafe code

This commit is contained in:
Benjamin Vedder 2023-04-05 21:29:21 +02:00
parent 8ec7072af2
commit 9a436992b7
1 changed files with 4 additions and 1 deletions

View File

@ -585,7 +585,10 @@ bool lispif_restart(bool print, bool load_code) {
lispif_load_vesc_extensions();
lbm_set_dynamic_load_callback(lispif_vesc_dynamic_loader);
int code_chars = strnlen(code_data, code_len);
int code_chars = 0;
if (code_data) {
code_chars = strnlen(code_data, code_len);
}
// Load imports
if (code_len > code_chars + 3) {