[Patch] Fixed DS12C887/TC8521 RTC days in month index

Post Reply
User avatar
Tale
Posts: 6
Joined: Tue 13 Nov, 2018 4:00 pm
Location: The Netherlands

[Patch] Fixed DS12C887/TC8521 RTC days in month index

Post by Tale » Thu 03 Jan, 2019 6:09 pm

I happened to stumble upon this apparent bug in source code, but I haven't confirmed it actually happens (because I don't really know where these RTCs are used). Anyway, I'm pretty sure that without this patch PCem could potentionally crash when it tries to index rtc_days_in_month[12], which is out of bounds, hence the patch. But I guess it would still be good to confirm this actually helps before applying it...
Attachments
rtc_days_in_month.patch
(1.13 KiB) Downloaded 75 times

User avatar
SarahWalker
Site Admin
Posts: 1699
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Fixed DS12C887/TC8521 RTC days in month index

Post by SarahWalker » Sat 12 Jan, 2019 4:51 pm

Looks like this would only be a problem if PCem was running at midnight on the last day of the month, and even then the RTC would most likely sync with the host machine so the error would be pretty short lived. Still, good to have it fixed! Merged at rev 1203.

Post Reply