summaryrefslogtreecommitdiff
path: root/app-admin/conky/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-admin/conky/files
reinit the tree, so we can have metadata
Diffstat (limited to 'app-admin/conky/files')
-rw-r--r--app-admin/conky/files/conky-1.10.4-x11-build.patch31
-rw-r--r--app-admin/conky/files/conky-1.10.6-new_graph-oor.patch35
2 files changed, 66 insertions, 0 deletions
diff --git a/app-admin/conky/files/conky-1.10.4-x11-build.patch b/app-admin/conky/files/conky-1.10.4-x11-build.patch
new file mode 100644
index 000000000000..eb113a47fd57
--- /dev/null
+++ b/app-admin/conky/files/conky-1.10.4-x11-build.patch
@@ -0,0 +1,31 @@
+From 178015a9495b7d40031ed7459e4f6b6731633a7c Mon Sep 17 00:00:00 2001
+From: shizeeg <shizeeque@gmail.com>
+Date: Thu, 8 Sep 2016 18:24:29 +0300
+Subject: [PATCH] Fix build without X11 (#317)
+
+---
+ src/conky.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/conky.cc b/src/conky.cc
+index 0a812fc..4c5da94 100644
+--- a/src/conky.cc
++++ b/src/conky.cc
+@@ -1404,6 +1404,9 @@ static void draw_string(const char *s)
+
+ int draw_each_line_inner(char *s, int special_index, int last_special_applied)
+ {
++#ifndef BUILD_X11
++ static int cur_x, cur_y; /* current x and y for drawing */
++#endif
+ #ifdef BUILD_X11
+ int font_h = 0;
+ int cur_y_add = 0;
+@@ -1934,6 +1937,7 @@ static void draw_text(void)
+
+ static void draw_stuff(void)
+ {
++ static int text_offset_x, text_offset_y; /* offset for start position */
+ text_offset_x = text_offset_y = 0;
+ #ifdef BUILD_IMLIB2
+ cimlib_render(text_start_x, text_start_y, window.width, window.height);
diff --git a/app-admin/conky/files/conky-1.10.6-new_graph-oor.patch b/app-admin/conky/files/conky-1.10.6-new_graph-oor.patch
new file mode 100644
index 000000000000..18091702f681
--- /dev/null
+++ b/app-admin/conky/files/conky-1.10.6-new_graph-oor.patch
@@ -0,0 +1,35 @@
+From 2600d01373ce04b34f698f3887e90a35c77bda61 Mon Sep 17 00:00:00 2001
+From: labath <pavelo@centrum.sk>
+Date: Tue, 31 Jan 2017 01:31:09 +0000
+Subject: [PATCH] Fix an out-of-range error in new_graph (#356)
+
+The code was multiplying the index with the size of the element, and
+then adding it to the typed pointer (resulting in a double
+multiplication and an OOB access).
+
+Replace the buggy code with a slightly safer c++ alternative.
+---
+ src/specials.cc | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/specials.cc b/src/specials.cc
+index ee941eb..73bd2a2 100644
+--- a/src/specials.cc
++++ b/src/specials.cc
+@@ -519,14 +519,12 @@ void new_graph(struct text_object *obj, char *buf, int buf_max_size, double val)
+ DBGP("reallocing graph from %d to %d", s->graph_allocated, s->graph_width);
+ if (!s->graph) {
+ /* initialize */
+- memset(graph, 0, s->graph_width * sizeof(double));
++ std::fill_n(graph, s->graph_width, 0.0);
+ s->scale = 100;
+ } else {
+ if (s->graph_width > s->graph_allocated) {
+ /* initialize the new region */
+- memset(graph + (s->graph_allocated * sizeof(double)), 0,
+- (s->graph_width - s->graph_allocated) *
+- sizeof(double));
++ std::fill(graph + s->graph_allocated, graph + s->graph_width, 0.0);
+ }
+ }
+ s->graph = graph;