From: Joey Castillo Date: Wed, 19 Jan 2022 22:22:31 +0000 (-0500) Subject: fix out of bounds access when position != 0 X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=3efdcd78a1fd470ca47fdd30c3251170d2f4f03b;p=sensor-watch.git fix out of bounds access when position != 0 --- diff --git a/watch-library/watch/watch_slcd.c b/watch-library/watch/watch_slcd.c index 4bcb165..1b1e53e 100644 --- a/watch-library/watch/watch_slcd.c +++ b/watch-library/watch/watch_slcd.c @@ -236,7 +236,7 @@ void watch_display_string(char *string, uint8_t position) { while(string[i] != 0) { watch_display_character(string[i], position + i); i++; - if (i >= Num_Chars) break; + if (position + i >= Num_Chars) break; } // uncomment this line to see screen output on terminal, i.e. // FR 29