Bug 8915 - xscreensaver hack "epicycle" dumps core
xscreensaver hack "epicycle" dumps core
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: xscreensaver (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-27 05:28 EST by jay
Modified: 2014-03-16 22:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-31 12:26:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jay 2000-01-27 05:28:26 EST
The "epicycle" screenhack will dump core when given the option
"-max_circles 2".

NOTE: This affects all versions of xscreensaver since 2.18.

The following patch fixes this:-




diff -u -r1.1 xscreensaver-3.22/hacks/epicycle.c
--- xscreensaver-3.22/hacks/epicycle.c  2000/01/26 22:36:21     1.1
+++ xscreensaver-3.22/hacks/epicycle.c  2000/01/26 22:39:58
@@ -266,7 +266,10 @@

   /* There are between minCircles and maxCircles in each figure.
    */
-  n = minCircles + random() % (maxCircles - minCircles);
+  if (maxCircles == minCircles)
+    n = minCircles;            /* Avoid division by zero. */
+  else
+    n = minCircles + random() % (maxCircles - minCircles);

   head = NULL;
   while (n--)
Comment 1 Bill Nottingham 2000-01-31 12:26:59 EST
Fixed in 3.23-1.

Note You need to log in before you can comment on or make changes to this bug.