projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
411da92
)
fixed potential crash bug when processing manipulated tape files
author
Holger Schemel
<info@artsoft.org>
Tue, 29 Jun 2021 11:29:02 +0000
(13:29 +0200)
committer
Holger Schemel
<info@artsoft.org>
Tue, 29 Jun 2021 11:29:11 +0000
(13:29 +0200)
src/tape.c
patch
|
blob
|
history
diff --git
a/src/tape.c
b/src/tape.c
index 0c99d6802582ae5376635c932f585a5da959045f..449e79601bd399949549390286a977873d581ac8 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-312,7
+312,8
@@
static void DrawVideoDisplay_DateTime(unsigned int state, unsigned int value)
char s[MAX_DATETIME_STRING_SIZE];
int year2 = value / 10000;
int year4 = (year2 < 70 ? 2000 + year2 : 1900 + year2);
- int month_index = (value / 100) % 100;
+ int month_index_raw = (value / 100) % 100;
+ int month_index = month_index_raw % 12; // prevent invalid index
int month = month_index + 1;
int day = value % 100;