Bug 91406

Summary: KStars: Array subscript out of range (INDI)
Product: [Applications] kstars Reporter: Marcin Garski <mgarski>
Component: generalAssignee: kstars
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Marcin Garski 2004-10-15 20:07:24 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

In indi/celestrongps.cpp there is section:

// North/South movement is illegal
 if (lastMove[NORTH] && lastMove[SOUTH])	
 {

------

In:
 indi/celestrongps.h
 indi/lx200generic.h

you can find:

int lastMove[4];

------
But in:
indi/celestronprotocol.h

you can find what NORTH and SOUTH is:

#if REVERSE_NS > 0
#define	NORTH		0
#define	SOUTH		4
#else
#define	NORTH		4
#define	SOUTH		0
#endif

------
In if() comparsion you check fifth element (it doesn't exist) of four elements array.
In #define '4' should be probably replaced by '3'.
Comment 1 kstars 2004-10-20 06:15:40 UTC
CVS commit by harris: 

Fixing bug #91406.  Some #define values were wrong.  Thanks for the 
report.

BUG: 91406
CCMAIL: kstars-devel@kde.org
 


  M +3 -3      celestronprotocol.h   1.2


--- kdeedu/kstars/kstars/indi/celestronprotocol.h  #1.1:1.2
@@ -50,11 +50,11 @@
 #if REVERSE_NS > 0
 #define NORTH           0
-#define SOUTH           4
+#define SOUTH           3
 #else
-#define NORTH           4
+#define NORTH           3
 #define SOUTH           0
 #endif
 
-#define EAST            3
+#define EAST            2
 #define WEST            1