Browse Source

update xscreensaver package

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 6 years ago
parent
commit
24f94a066e
  1. 109
      SOURCES/xscreensaver-5.00b5-sanitize-hacks.patch
  2. 11
      SOURCES/xscreensaver-5.12-test-passwd-segv-tty.patch
  3. 21
      SOURCES/xscreensaver-5.12-tests-miscfix.patch
  4. 35
      SOURCES/xscreensaver-5.32-0004-cubestorm-enable-double-buffer-on-linux.patch
  5. 84
      SOURCES/xscreensaver-5.35-0101-XIO-print-C-backtrace-on-error.patch
  6. 38
      SOURCES/xscreensaver-5.35-webcollage-default-nonet.patch
  7. 37
      SOURCES/xscreensaver-5.36-0003-reset_strip-kill-gcc7-Wint-in-bool-context.patch
  8. 51
      SOURCES/xscreensaver-5.36-0004-init_crystal-kill-gcc7-Wint-in-bool-context.patch
  9. 96
      SOURCES/xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warnings.patch
  10. 29
      SOURCES/xscreensaver-5.39-0001-driver-Makefile.in-fix-path-for-font-retry.o.patch
  11. 49
      SOURCES/xscreensaver-5.39-0002-crumbler-fix-color-overvalue-when-accessing-colors-a.patch
  12. 9
      SOURCES/xscreensaver-autostart
  13. 6
      SOURCES/xscreensaver-autostart.desktop
  14. 52
      SPECS/xscreensaver.spec

109
SOURCES/xscreensaver-5.00b5-sanitize-hacks.patch

@ -0,0 +1,109 @@ @@ -0,0 +1,109 @@
--- xscreensaver-5.00b5/hacks/barcode.c.sanitize-hacks 2006-04-06 15:40:32.000000000 +0900
+++ xscreensaver-5.00b5/hacks/barcode.c 2006-05-18 15:09:13.000000000 +0900
@@ -117,8 +117,6 @@
"belly",
"bliss",
"bogosity",
- "boobies",
- "boobs",
"booty",
"bread",
"bubba",
@@ -131,7 +129,6 @@
"children",
"chocolate",
"CLONE",
- "cock",
"constriction",
"contrition",
"cop",
@@ -171,7 +168,6 @@
"fear",
"fever",
"filth",
- "flatulence",
"fluff",
"fnord",
"freedom",
@@ -188,9 +184,7 @@
"happiness",
"hate",
"helplessness",
- "hemorrhoid",
"hermaphrodite",
- "heroin",
"heroine",
"hope",
"hysteria",
@@ -265,7 +259,6 @@
"punishment",
"punk rock",
"punk",
- "pussy",
"quagmire",
"quarantine",
"quartz",
@@ -274,7 +267,6 @@
"rage",
"readout",
"reality",
- "rectum",
"reject",
"rejection",
"respect",
@@ -333,8 +325,6 @@
"vegetarian",
"venom",
"verifiability",
- "viagra",
- "vibrator",
"victim",
"vignette",
"villainy",
--- xscreensaver-5.00b5/hacks/glx/glsnake.c.sanitize-hacks 2006-05-04 04:39:21.000000000 +0900
+++ xscreensaver-5.00b5/hacks/glx/glsnake.c 2006-05-18 15:09:13.000000000 +0900
@@ -535,7 +535,7 @@
PIN, ZERO, RIGHT, RIGHT, ZERO, PIN, PIN, ZERO, PIN, PIN, ZERO,
RIGHT, ZERO }
},
- { "k's turd",
+ { "caterpillar",
{ RIGHT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT,
RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN, RIGHT, LEFT, RIGHT, PIN,
RIGHT, LEFT, RIGHT, PIN, ZERO }
@@ -560,22 +560,22 @@
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO, ZERO }
},
- { "kissy box",
+ { "ribbon",
{ PIN, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, PIN, ZERO, ZERO, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, ZERO,
ZERO, PIN, ZERO }
},
- { "erect penis", /* thanks benno */
+ { "shuffle board", /* thanks benno */
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
PIN, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO }
},
- { "flaccid penis",
+ { "anchor",
{ PIN, ZERO, PIN, PIN, ZERO, ZERO, PIN, ZERO, ZERO, ZERO, PIN,
PIN, ZERO, ZERO, ZERO, RIGHT, PIN, ZERO, ZERO, ZERO, ZERO, ZERO,
ZERO, ZERO }
},
- { "vagina",
+ { "engagement ring",
{ RIGHT, ZERO, ZERO, ZERO, RIGHT, ZERO, ZERO, PIN, ZERO, ZERO,
LEFT, ZERO, ZERO, ZERO, LEFT, ZERO, LEFT, PIN, LEFT, PIN, RIGHT,
PIN, RIGHT, ZERO }
@@ -995,7 +995,7 @@
{ "Parrot",
{ ZERO, ZERO, ZERO, ZERO, RIGHT, RIGHT, ZERO, LEFT, PIN, RIGHT, ZERO, RIGHT, ZERO, RIGHT, ZERO, RIGHT, PIN, LEFT, ZERO, RIGHT, LEFT, ZERO, PIN, ZERO }
},
- { "Penis",
+ { "Shuttle",
{ PIN, PIN, RIGHT, ZERO, PIN, PIN, ZERO, PIN, ZERO, ZERO, RIGHT, PIN, LEFT, ZERO, ZERO, PIN, ZERO, PIN, PIN, ZERO, LEFT, PIN, PIN, ZERO }
},
{ "PictureComingSoon",

11
SOURCES/xscreensaver-5.12-test-passwd-segv-tty.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
--- xscreensaver-5.12/driver/passwd.c.debug2 2008-12-27 19:17:26.000000000 +0900
+++ xscreensaver-5.12/driver/passwd.c 2011-04-03 21:55:26.000000000 +0900
@@ -205,7 +205,7 @@
{
# ifdef HAVE_SYSLOG
struct passwd *pw = getpwuid (getuid ());
- char *d = DisplayString (si->dpy);
+ char *d = (si->dpy ? DisplayString (si->dpy) : 0);
char *u = (pw && pw->pw_name ? pw->pw_name : "???");
int opt = 0;
int fac = 0;

21
SOURCES/xscreensaver-5.12-tests-miscfix.patch

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
--- xscreensaver-5.12/driver/test-xdpms.c.extra 2002-03-19 08:57:42.000000000 +0900
+++ xscreensaver-5.12/driver/test-xdpms.c 2011-04-03 22:05:01.000000000 +0900
@@ -29,7 +29,6 @@
#include <X11/Xproto.h>
#include <X11/extensions/dpms.h>
-#include <X11/extensions/dpmsstr.h>
extern Bool DPMSQueryExtension (Display *dpy, int *event_ret, int *error_ret);
extern Bool DPMSCapable (Display *dpy);
--- xscreensaver-5.12/driver/Makefile.in 2011-04-03 22:49:32.000000000 +0900
+++ xscreensaver-5.12/driver/Makefile.in.save 2011-04-03 22:49:32.000000000 +0900
@@ -850,7 +850,7 @@
test-mlstring: test-mlstring.o
$(CC) -DTEST $(LDFLAGS) -o $@ test-mlstring.o $(SAVER_LIBS)
-TEST_FADE_OBJS = test-fade.o $(UTILS_SRC)/fade.o $(DEMO_UTIL_OBJS)
+TEST_FADE_OBJS = test-fade.o $(UTILS_BIN)/fade.o $(DEMO_UTIL_OBJS)
test-fade: test-fade.o $(UTILS_BIN)/fade.o
$(CC) $(LDFLAGS) -o $@ $(TEST_FADE_OBJS) $(SAVER_LIBS)

35
SOURCES/xscreensaver-5.32-0004-cubestorm-enable-double-buffer-on-linux.patch

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
From 6aebd80b87cdc42ba4871bd8284556b5f195f094 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sun, 1 Feb 2015 21:10:41 +0900
Subject: [PATCH] cubestorm: enable double buffer on linux

Like noof, at least on Fedora 22 x86_64
while cubestorm shows some graphics on xscreensaver-demo
window, on full screen saver mode cubestorm
shows just a blank screen, like as written
on launchpad #1390304.

Enabling double buffering seems to make
cubestorm show graphics on save mode like
noof.
---
hacks/glx/cubestorm.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/hacks/glx/cubestorm.c b/hacks/glx/cubestorm.c
index f3fd88b..da0ae53 100644
--- a/hacks/glx/cubestorm.c
+++ b/hacks/glx/cubestorm.c
@@ -229,6 +229,9 @@ init_cube (ModeInfo *mi)
# ifdef HAVE_JWZGLES
dbuf_p = True;
# endif
+# ifdef __linux__
+ dbuf_p = True;
+# endif
bp = &bps[MI_SCREEN(mi)];
--
2.2.2

84
SOURCES/xscreensaver-5.35-0101-XIO-print-C-backtrace-on-error.patch

@ -0,0 +1,84 @@ @@ -0,0 +1,84 @@
From 735cc1af7595890d9cd567f36dabaf41fae4210e Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Mon, 11 Jul 2016 16:53:14 +0900
Subject: [PATCH] XIO: print C backtrace on error

For debugging purpose, show C backtrace with XIO
error happens.
---
driver/xscreensaver.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c
index 76969f2..04c2669 100644
--- a/driver/xscreensaver.c
+++ b/driver/xscreensaver.c
@@ -148,10 +148,15 @@
# include "config.h"
#endif
+#include <features.h>
#include <stdio.h>
#include <ctype.h>
#include <X11/Xlib.h>
+#ifdef __GNU_LIBRARY__
+#include <execinfo.h>
+#endif
+
#ifdef ENABLE_NLS
# include <locale.h>
# include <libintl.h>
@@ -504,6 +509,41 @@ startup_ehandler (String name, String type, String class,
exit (1);
}
+static void
+show_cstyle_backtrace(void)
+{
+#ifdef __GNU_LIBRARY__
+ void *bt_array[128];
+ size_t bt_size;
+
+ bt_size = backtrace(bt_array, countof(bt_array));
+ fprintf(stderr, "C backtrace:\n");
+ backtrace_symbols_fd(bt_array, bt_size, STDERR_FILENO);
+#endif
+}
+
+static int (*default_xio_ehandler)(Display *dpy) = 0;
+
+static int
+show_debug_info_xio_ehandler(Display *dpy)
+{
+ show_cstyle_backtrace();
+ if (default_xio_ehandler){
+ (*default_xio_ehandler)(dpy);
+ }
+ return 0;
+}
+
+static void
+hack_IOErrorHandler(void)
+{
+#ifdef __GNU_LIBRARY__
+ XIOErrorHandler old_handler;
+ old_handler = XSetIOErrorHandler(show_debug_info_xio_ehandler);
+ default_xio_ehandler = old_handler;
+#endif
+}
+
/* The zillions of initializations.
*/
@@ -1570,6 +1610,7 @@ main (int argc, char **argv)
initialize_stderr (si);
handle_signals (si);
+ hack_IOErrorHandler();
make_splash_dialog (si);
--
2.7.4

38
SOURCES/xscreensaver-5.35-webcollage-default-nonet.patch

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
--- xscreensaver-5.35/hacks/config/webcollage.xml.nonet 2016-04-08 11:15:38.000000000 +0900
+++ xscreensaver-5.35/hacks/config/webcollage.xml 2016-05-26 23:47:38.000000000 +0900
@@ -28,8 +28,8 @@
<string id="filter" _label="Per-image filter program" arg="-filter %"/>
<string id="filter2" _label="Overall filter program" arg="-filter2 %"/>
<file id="dictionary" _label="Dictionary file" arg="-dictionary %"/>
- <file id="dir" _label="Image directory" arg="-directory %"/>
-->
+ <file id="dir" _label="Image directory" arg="-directory %"/>
<xscreensaver-updater />
@@ -49,6 +49,11 @@
See also https://www.jwz.org/webcollage/
+NOTE:
+Webcollage on Fedora does not connect to internet by default
+and uses image files on your local disk. If you want webcollage to
+search for image files on net, use webcollage.original .
+
Written by Jamie Zawinski; 1999.
</_description>
</screensaver>
--- xscreensaver-5.26/hacks/webcollage.man.nonet 2009-10-14 06:12:31.000000000 +0900
+++ xscreensaver-5.26/hacks/webcollage.man 2013-12-10 13:40:38.139050305 +0900
@@ -178,6 +178,11 @@
.TP 8
.B \-fps
Display the current frame rate and CPU load (MacOS only).
+.SH NOTES FOR FEDORA USER
+Webcollage on Fedora uses '-directory' option by default, so it
+.B does not connect to internet
+and uses image files on your local disk. If you want webcollage to
+search for image files on net, use webcollage.original .
.SH ENVIRONMENT
.PP
.TP 8

37
SOURCES/xscreensaver-5.36-0003-reset_strip-kill-gcc7-Wint-in-bool-context.patch

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
From 5076baca314c08c118d55f353d0f54659e328c65 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 3 Feb 2017 23:37:57 +0900
Subject: [PATCH 3/5] reset_strip: kill gcc7 -Wint-in-bool-context

gcc7 -Wall now warns:
../../../hacks/glx/glmatrix.c: In function 'reset_strip':
../../../hacks/glx/glmatrix.c:260:28: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
!(random() % (GRID_SIZE-5)*5))
~~~~~~~~~~~~~~~~~~~~~~~~~^~~

This warning means that the usage of "*5" is highly questionable
because this multiplication does not change the result of boolean
result (unless such multiplication overflows - which is undefined).

Judging from the comment above this line, perhaps parentheses are
missing.
---
hacks/glx/glmatrix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c
index 47069eb..c02d56c 100644
--- a/hacks/glx/glmatrix.c
+++ b/hacks/glx/glmatrix.c
@@ -257,7 +257,7 @@ reset_strip (ModeInfo *mi, strip *s)
if (do_clock &&
!time_displayed_p &&
(i < GRID_SIZE-5) && /* display approx. once per 5 strips */
- !(random() % (GRID_SIZE-5)*5))
+ !(random() % ((GRID_SIZE-5)*5)))
{
int j;
char text[80];
--
2.11.1

51
SOURCES/xscreensaver-5.36-0004-init_crystal-kill-gcc7-Wint-in-bool-context.patch

@ -0,0 +1,51 @@ @@ -0,0 +1,51 @@
From 9c8a95b916897ce7c2f23aa9d254517699d5b8b1 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sat, 4 Feb 2017 00:41:46 +0900
Subject: [PATCH 4/5] init_crystal: kill gcc7 -Wint-in-bool-context

gcc7 -Wall now warns:
../../hacks/crystal.c:1009:31: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
../../hacks/crystal.c:97:30:
#define NRAND(n) ( (n) ? (int) (LRAND() % (n)) : 0)
~~~
../../hacks/crystal.c:1009:31:
cryst->offset_h = NRAND(2 * cryst->offset_h);
../../hacks/crystal.c:97:31: note: in definition of macro 'NRAND'
#define NRAND(n) ( (n) ? (int) (LRAND() % (n)) : 0)
^

This warning means that the usage of "2 *" is highly questionable
because this multiplication does not change the result of boolean
result (unless such multiplication overflows - which is undefined).

However, in this case, such multiplicated value is used afterwards
(as a denominator), so this warning here is not meaningful.

But this warning can be easily eliminated, so let's fix this.
---
hacks/crystal.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/hacks/crystal.c b/hacks/crystal.c
index 9dfa5ea..efa7704 100644
--- a/hacks/crystal.c
+++ b/hacks/crystal.c
@@ -1005,8 +1005,13 @@ init_crystal(ModeInfo * mi)
cryst->offset_h = (int) ((cryst->win_height - cryst->b * cos((
cryst->gamma - 90) * PI_RAD)) / 2.0);
if (!centre) {
- if (cryst->offset_h > 0)
- cryst->offset_h = NRAND(2 * cryst->offset_h);
+ if (cryst->offset_h > 0) {
+ /* once put the multiplication result to another variable here
+ to aviod warning from gcc7 -Wint-in-bool-context
+ */
+ int denom = 2 * cryst->offset_h;
+ cryst->offset_h = NRAND(denom);
+ }
cryst->offset_w = (int) (cryst->win_width - cryst->a -
cryst->b *
fabs(sin((cryst->gamma - 90) * PI_RAD)));
--
2.11.1

96
SOURCES/xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warnings.patch

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
From 0d26e4514d7d6c90d2c5e35749c0b83121a66b77 Mon Sep 17 00:00:00 2001
From: "mtasaka@fedoraproject.org" <mtasaka@fedoraproject.org>
Date: Tue, 7 Feb 2017 16:40:52 +0900
Subject: [PATCH] misc: kill gcc warn_unused_result warnings

Remove misc warnings generated gcc -Wall with
"warning: ignoring return value of 'foo',
declared with attribute warn_unused_result".

For setuid() and fgets(), really check the returned value.
For system(), for now just use empty body to avoid this
warning. Note that casting the result to (void) does not
remove these warnings.
---
driver/demo-Gtk.c | 9 +++++++--
hacks/glx/sonar-icmp.c | 2 +-
hacks/glx/sonar.c | 5 +++--
hacks/recanim.c | 6 +++++-
4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/driver/demo-Gtk.c b/driver/demo-Gtk.c
index f5c4839..7c34846 100644
--- a/driver/demo-Gtk.c
+++ b/driver/demo-Gtk.c
@@ -4423,7 +4423,8 @@ kde_screensaver_active_p (void)
FILE *p = popen ("dcop kdesktop KScreensaverIface isEnabled 2>/dev/null",
"r");
char buf[255];
- fgets (buf, sizeof(buf)-1, p);
+ if (!p) return False;
+ if (!fgets (buf, sizeof(buf)-1, p)) return False;
pclose (p);
if (!strcmp (buf, "true\n"))
return True;
@@ -4434,7 +4435,11 @@ kde_screensaver_active_p (void)
static void
kill_kde_screensaver (void)
{
- system ("dcop kdesktop KScreensaverIface enable false");
+ /* Use empty body to kill warning from gcc -Wall with
+ "warning: ignoring return value of 'system',
+ declared with attribute warn_unused_result"
+ */
+ if (system ("dcop kdesktop KScreensaverIface enable false")) {}
}
diff --git a/hacks/glx/sonar-icmp.c b/hacks/glx/sonar-icmp.c
index 8256270..26eb90d 100644
--- a/hacks/glx/sonar-icmp.c
+++ b/hacks/glx/sonar-icmp.c
@@ -1634,7 +1634,7 @@ sonar_init_ping (Display *dpy, char **error_ret, char **desc_ret,
fprintf (stderr, "%s: unable to open icmp socket\n", progname);
/* Disavow privs */
- setuid(getuid());
+ if (setuid(getuid()) == -1) abort();
pd->pid = getpid() & 0xFFFF;
pd->seq = 0;
diff --git a/hacks/glx/sonar.c b/hacks/glx/sonar.c
index f3a4d9d..2c6ca5b 100644
--- a/hacks/glx/sonar.c
+++ b/hacks/glx/sonar.c
@@ -930,8 +930,9 @@ init_sensor (ModeInfo *mi)
sp->ssd = sonar_init_ping (MI_DISPLAY (mi), &sp->error, &sp->desc,
ping_arg, ping_timeout, resolve_p, times_p,
debug_p);
- else
- setuid(getuid()); /* Disavow privs if not pinging. */
+ else {
+ if (setuid(getuid()) == -1) abort(); /* Disavow privs if not pinging. */
+ }
sp->start_time = double_time (); /* for error message timing */
diff --git a/hacks/recanim.c b/hacks/recanim.c
index 51379ed..a526c25 100644
--- a/hacks/recanim.c
+++ b/hacks/recanim.c
@@ -324,7 +324,11 @@ screenhack_record_anim_free (record_anim_state *st)
" 2>&-",
fn);
fprintf (stderr, "%s: exec: %s\n", progname, cmd);
- system (cmd);
+ /* Use empty body to kill warning from gcc -Wall with
+ "warning: ignoring return value of 'system',
+ declared with attribute warn_unused_result"
+ */
+ if (system (cmd)) {}
if (stat (fn, &s))
{
--
2.9.3

29
SOURCES/xscreensaver-5.39-0001-driver-Makefile.in-fix-path-for-font-retry.o.patch

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
From 62c7604efdd985d7c03ab3042712c11d4ea5ca6c Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sun, 15 Apr 2018 13:33:51 +0900
Subject: [PATCH] driver/Makefile.in: fix path for font-retry.o

When building source on build-time specific path, make cannot
find font-retry.o:

gcc: error: ../../driver/../utils/font-retry.o: No such file or directory
---
driver/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/driver/Makefile.in b/driver/Makefile.in
index 765782d..de0faaf 100644
--- a/driver/Makefile.in
+++ b/driver/Makefile.in
@@ -157,7 +157,7 @@ SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
$(DEMO_UTIL_SRCS)
SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
$(UTILS_BIN)/logo.o $(UTILS_BIN)/yarandom.o \
- $(UTILS_BIN)/minixpm.o $(UTILS_SRC)/font-retry.o \
+ $(UTILS_BIN)/minixpm.o $(UTILS_BIN)/font-retry.o \
$(DEMO_UTIL_OBJS)
GETIMG_SRCS_1 = xscreensaver-getimage.c
--
2.17.0

49
SOURCES/xscreensaver-5.39-0002-crumbler-fix-color-overvalue-when-accessing-colors-a.patch

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
From 58f4a6f93b10d3ba65d9d62f128a30ffba2de72e Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sun, 15 Apr 2018 15:12:11 +0900
Subject: [PATCH] crumbler: fix color overvalue when accessing colors array

gcc8 -fsanitize=address detects the following error:

==30292==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62900003b8b8 at pc 0x00000040b27a bp 0x7fff47820090 sp 0x7fff47820080
READ of size 2 at 0x62900003b8b8 thread T0
#0 0x40b279 in draw_chunk ../../../hacks/glx/crumbler.c:680
#1 0x4129ac in draw_crumbler ../../../hacks/glx/crumbler.c:795
#2 0x439a21 in xlockmore_draw ../../hacks/xlockmore.c:628
#3 0x408dbe in run_screenhack_table ../../hacks/screenhack.c:586
#4 0x408dbe in main ../../hacks/screenhack.c:967
#5 0x7fa8ac7901ba in __libc_start_main ../csu/libc-start.c:308
#6 0x40a4a9 in _start (/home/tasaka1/rpmbuild/fedora-specific/xscreensaver/master/xscreensaver-5.39/x86_64-pc-linux-gnu/hacks/glx/crumbler+0x40a4a9)

0x62900003b8b8 is located 1720 bytes to the right of 16384-byte region [0x629000037200,0x62900003b200)
allocated by thread T0 here:
#0 0x7fa8b054de50 in calloc (/lib64/libasan.so.5+0xeee50)
#1 0x40fe98 in init_crumbler ../../../hacks/glx/crumbler.c:633
#2 0x3f7fffffffffffff (<unknown module>)

SUMMARY: AddressSanitizer: heap-buffer-overflow ../../../hacks/glx/crumbler.c:680 in draw_chunk

Apparently at the line 680, c->color is oversized. I guess at the lines 367-368, parentheses are
incorrectly added: c2->color should have the value no more than bp->ncolors - 1.
---
hacks/glx/crumbler.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hacks/glx/crumbler.c b/hacks/glx/crumbler.c
index cf21a94..f9a908a 100644
--- a/hacks/glx/crumbler.c
+++ b/hacks/glx/crumbler.c
@@ -364,8 +364,8 @@ split_chunk (ModeInfo *mi, chunk *c, int nchunks)
chunks[i] = c2;
chunks[i]->nverts = 0;
c2->verts = (qh_vertex_t *) calloc (c->nverts, sizeof(*c2->verts));
- c2->color = (c->color + (random() % (1 + (bp->ncolors / 3)))
- % bp->ncolors);
+ c2->color = (c->color + (random() % (1 + (bp->ncolors / 3))))
+ % bp->ncolors;
}
/* Add the verts to the approprate chunks
--
2.17.0

9
SOURCES/xscreensaver-autostart

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
#!/bin/sh

# Don't launch xscreensaver if gnome-screensaver
# is installed

if [ -x /usr/bin/gnome-screensaver ] ; then exit 0 ; fi
if [ -x /usr/bin/mate-screensaver ] ; then exit 0 ; fi

exec xscreensaver -nosplash

6
SOURCES/xscreensaver-autostart.desktop

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=xscreensaver-autostart
Comment=Autostart xscreensaver
Exec=/usr/libexec/xscreensaver-autostart
Terminal=false

52
SPECS/xscreensaver.spec

@ -6,7 +6,9 @@ @@ -6,7 +6,9 @@

%define modular_conf 1
%define split_getimage 0
%if 0%{?fedora} >= 14
%define split_getimage 1
%endif

%define fedora_rel 1

@ -20,7 +22,11 @@ @@ -20,7 +22,11 @@
# EPEL6
%{!?__git:%define __git git}

%if 0%{?fedora}
%define default_text %{_sysconfdir}/fedora-release
%else
%define default_text %{_sysconfdir}/system-release
%endif
%define default_URL http://planet.fedoraproject.org/rss20.xml

%define pam_ver 0.80-7
@ -29,12 +35,14 @@ @@ -29,12 +35,14 @@
%define update_po 1
%define build_tests 0

%undefine _changelog_trimtime

Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Summary: X screen saver and locker
Name: %{name}
Version: %{mainversion}
Release: %{fedora_rel}%{?dist}%{?extrarel}.1
Release: %{fedora_rel}%{?dist}%{?extrarel}
Epoch: 1
License: MIT
Group: Amusements/Graphics
@ -71,13 +79,16 @@ Patch52: xscreensaver-5.12-tests-miscfix.patch @@ -71,13 +79,16 @@ Patch52: xscreensaver-5.12-tests-miscfix.patch
#
# Enable double buffer on cubestorm
Patch3204: xscreensaver-5.32-0004-cubestorm-enable-double-buffer-on-linux.patch
# splodesic: avoid using "depth" name not to make X internal collision
# reset_strip: kill gcc7 -Wint-in-bool-context
Patch3603: xscreensaver-5.36-0003-reset_strip-kill-gcc7-Wint-in-bool-context.patch
# init_crystal: kill gcc7 -Wint-in-bool-context
Patch3604: xscreensaver-5.36-0004-init_crystal-kill-gcc7-Wint-in-bool-context.patch
# misc: kill gcc warn_unused_result warnings
Patch3607: xscreensaver-5.36-0007-misc-kill-gcc-warn_unused_result-warnings.patch
# driver/Makefile.in: fix path for font-retry.o
Patch3901: xscreensaver-5.39-0001-driver-Makefile.in-fix-path-for-font-retry.o.patch
# crumbler: fix color overvalue when accessing colors array
Patch3902: xscreensaver-5.39-0002-crumbler-fix-color-overvalue-when-accessing-colors-a.patch
#
# Debugging patch
# Not apply by default
@ -132,7 +143,10 @@ BuildRequires: libXext-devel @@ -132,7 +143,10 @@ BuildRequires: libXext-devel
BuildRequires: libXi-devel
BuildRequires: libXinerama-devel
BuildRequires: libXmu-devel
# xscreensaver 5.39: check if the following can be removed
BuildRequires: libXpm-devel
# xscreensaver 5.39
BuildRequires: libpng-devel
# Write explicitly
BuildRequires: libXrandr-devel
BuildRequires: libXt-devel
@ -350,6 +364,8 @@ rm -f driver/XScreenSaver_ad.h @@ -350,6 +364,8 @@ rm -f driver/XScreenSaver_ad.h
%__cat %PATCH3603 | %__git am
%__cat %PATCH3604 | %__git am
#%%__cat %PATCH3607 | %__git am
%__cat %PATCH3901 | %__git am
%__cat %PATCH3902 | %__git am

#%%__cat %PATCH13501 | %%__git am

@ -417,11 +433,14 @@ change_option driver/XScreenSaver.ad.in \ @@ -417,11 +433,14 @@ change_option driver/XScreenSaver.ad.in \
%endif
%__git commit -m "%PATCH_desc" -a

# peepers: 5.39: too scary (mtasaka)
%global PATCH_desc \
# Disable the following hacks by default \
# (disable, not remove)
silence_hack driver/XScreenSaver.ad.in \
bsod flag
bsod flag \
peepers \
%{nil}
%__git commit -m "%PATCH_desc" -a

%global PATCH_desc \
@ -611,9 +630,19 @@ rm -f configure @@ -611,9 +630,19 @@ rm -f configure
mkdir clang-analyze
%endif

# Workaround for 5.39
mkdir -p hacks/images || true
if [ ! -f hacks/images/Makefile ] ; then
cat > hacks/images/Makefile <<EOF
default:
install:
EOF
fi
# Workaround end

%if 0%{?use_clang_analyze} < 1
for dir in \
utils driver hacks hacks/glx po
utils driver ../hacks/images hacks hacks/glx po
do
%__make %{?_smp_mflags} -k \
-C $dir \
@ -958,9 +987,6 @@ echo "%%{_libexecdir}/%%{name}/webcollage.original" >> \ @@ -958,9 +987,6 @@ echo "%%{_libexecdir}/%%{name}/webcollage.original" >> \
#
chmod -R a+r,u+w,og-w ${RPM_BUILD_ROOT}

%clean
rm -rf ${RPM_BUILD_ROOT}

%post base
%if %{modular_conf}
%{_sbindir}/update-xscreensaver-hacks
@ -1025,6 +1051,18 @@ exit 0 @@ -1025,6 +1051,18 @@ exit 0
%endif

%changelog
* Sun Apr 15 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:5.39-2
- crumbler: fix color overvalue when accessing colors array

* Sun Apr 15 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:5.39-1
- Update to 5.39

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.38-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 30 2018 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1:5.38-2
- esper: fix uninitialized variable

* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1:5.38-1.1
- Rebuilt for switch to libxcrypt


Loading…
Cancel
Save