From 5f0030fd1370c4d03dbb2e0d3086f5e618a33749 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 28 Apr 2024 23:59:44 +0100 Subject: gentoo auto-resync : 28:04:2024 - 23:59:44 --- ...-typo-causing-out-of-bounds-memory-access.patch | 27 ++++++++++ x11-plugins/wmcalendar/files/wmcalendar-c99.patch | 63 ++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch create mode 100644 x11-plugins/wmcalendar/files/wmcalendar-c99.patch (limited to 'x11-plugins/wmcalendar/files') diff --git a/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch b/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch new file mode 100644 index 000000000000..8565fe879b29 --- /dev/null +++ b/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch @@ -0,0 +1,27 @@ +From ce49fa7696aadb61bb770bc42181d258af4407de Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +Date: Sun, 28 Apr 2024 01:36:55 -0400 +Subject: [PATCH] fix obvious typo causing out of bounds memory access + +The size in the .h file doesn't match the loop access in the .c file. +Detected via LTO and -Waggressive-loop-optimizations +--- + wmCalendar.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/wmCalendar.c b/wmCalendar.c +index bf5640b..bfe68a1 100644 +--- a/wmCalendar.c ++++ b/wmCalendar.c +@@ -71,7 +71,7 @@ void initValues(){ + for(i = 0; i < 12; ++i) + for( j = 0; j < 6; ++j) + xdMonth[j][i] = xeMonth[j][i] - xsMonth[j][i] + 1; +- for(i = 0; i < 12; ++i) ++ for(i = 0; i < 10; ++i) + for( j = 0; j < 2; ++j) + xdYear[j][i] = xeYear[j][i] - xsYear[j][i] + 1; + for(i = 0; i < MAXBUTTON; ++i) +-- +2.43.2 + diff --git a/x11-plugins/wmcalendar/files/wmcalendar-c99.patch b/x11-plugins/wmcalendar/files/wmcalendar-c99.patch new file mode 100644 index 000000000000..fb37477108cd --- /dev/null +++ b/x11-plugins/wmcalendar/files/wmcalendar-c99.patch @@ -0,0 +1,63 @@ +From eb19c3c29d65b4e0e4f30d49c568846296ea4287 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +Date: Fri, 29 Mar 2024 10:21:50 -0400 +Subject: [PATCH 1/2] fix missing includes/prototypes that violate c99 + +Fixes various -Werror=implicit-function-declaration issues. +--- + calendar.c | 2 ++ + calendar.h | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/calendar.c b/calendar.c +index 4da3650..c847853 100644 +--- a/calendar.c ++++ b/calendar.c +@@ -1,4 +1,6 @@ + #include "calendar.h" ++#include "settings.h" ++#include "calendarfunc.h" + + time_t modtime; + struct calobj* calRoot; +diff --git a/calendar.h b/calendar.h +index bc9e576..7803d0c 100644 +--- a/calendar.h ++++ b/calendar.h +@@ -33,4 +33,5 @@ int getDayType(struct icaltimetype dt); + int calcDayType(struct icaltimetype dt); + char* read_stream(char *s, size_t size, void *d); + void checkicalversion(); ++int eventOnDay(struct icaltimetype dt, struct calobj* it); + +-- +2.43.2 + + +From a6f7c549f79a8fa50456f06352a3fd1457937c62 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +Date: Sun, 28 Apr 2024 01:34:58 -0400 +Subject: [PATCH 2/2] cast a struct pointing to itself to avoid + -Werror=incompatible-pointer-types + +This is already done the other way around at the beginning of the block. +--- + calendar.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/calendar.c b/calendar.c +index c847853..f8f875b 100644 +--- a/calendar.c ++++ b/calendar.c +@@ -326,7 +326,7 @@ void deleteCalObjs(){ + free(calRoot->text); + free(calRoot->comp); + free(calRoot); +- calRoot = help; ++ calRoot = (struct calobj*) help; + } + for(i = 0; i < 32; i++) + datetype[i][1] = 0; +-- +2.43.2 + -- cgit v1.2.3