Bug 8915

Summary: xscreensaver hack "epicycle" dumps core
Product: [Retired] Red Hat Linux Reporter: jay
Component: xscreensaverAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-31 17:26:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description jay 2000-01-27 10:28:26 UTC
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 17:26:59 UTC
Fixed in 3.23-1.