Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 213582 Details for
Bug 297467
kde-base/kstars-4.3.4 stack smashing "attack" on hardened
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch against kstars/kstars/skyobjects/saturnmoons.cpp
saturnmoons-fix-index-and-angle-errors.patch (text/plain), 7.47 KB, created by
Hugo Mildenberger
on 2009-12-20 17:07:25 UTC
(
hide
)
Description:
patch against kstars/kstars/skyobjects/saturnmoons.cpp
Filename:
MIME Type:
Creator:
Hugo Mildenberger
Created:
2009-12-20 17:07:25 UTC
Size:
7.47 KB
patch
obsolete
># This patch fixes four things: ># 1.) The author assumed C arrays would start with element 1. The ># consequence was a stack smashing "attack" detected when ># compiled with -fstack-protector-all ># 2.) summing up angles given in degrees with angles given in radians ># see double u = 2*W5 - 2*theta + psi; ># 3.) remove unnecessary calls to MapTo0To360Range ># 4.) remove unused, superflous arrays declarations ># ># HOWEVER: Saturn's moon position still appear to be wrong when ># compared to the output of JPL's solar system simulator ># for any given date (here: http://space.jpl.nasa.gov/) >--- kstars/kstars/skyobjects/saturnmoons.cpp.orig 2009-03-27 15:46:52.000000000 +0100 >+++ kstars/kstars/skyobjects/saturnmoons.cpp 2009-12-19 20:05:20.000000000 +0100 >@@ -111,8 +111,8 @@ > double A2[9], B2[9], C2[9]; > double A3[9], B3[9], C3[9]; > double A4[9], B4[9], C4[9]; >- double A5[9], B5[9], C5[9]; >- double A6[9], B6[9], C6[9]; >+ //double A5[9], B5[9], C5[9]; >+ //double A6[9], B6[9], C6[9]; > > Saturn->ecLong()->SinCos( sinJL, cosJL ); > Saturn->ecLat()->SinCos( sinJB, cosJB ); >@@ -153,29 +153,33 @@ > > //Longitudes of the satellites' nodes on the equatorial plane of Jupiter > >- double W0 = MapTo0To360Range(5.095*(t3 - 1866.39)); >+ //double W0 = MapTo0To360Range(5.095*(t3 - 1866.39)); > double W0rad = MapTo0To360Range(5.095*(t3 - 1866.39))*dms::DegToRad; > >- double W1 = MapTo0To360Range(74.4- 32.39*t2); >+ //double W1 = MapTo0To360Range(74.4- 32.39*t2); > double W1rad = MapTo0To360Range(74.4- 32.39*t2)*dms::DegToRad; > >- double W2 = MapTo0To360Range(134.3 - 92.62*t2); >+ //double W2 = MapTo0To360Range(134.3 - 92.62*t2); > double W2rad = MapTo0To360Range(134.3 - 92.62*t2)*dms::DegToRad; >- double W3 = MapTo0To360Range(42.0 - 0.5118*t5); >+ >+ //double W3 = MapTo0To360Range(42.0 - 0.5118*t5); > double W3rad = MapTo0To360Range(42.0 - 0.5118*t5)*dms::DegToRad; > > double W4 = MapTo0To360Range(276.59 - 0.5118*t5); >- double W4rad = MapTo0To360Range(276.59 - 0.5118*t5)*dms::DegToRad; >+ double W4rad = W4*dms::DegToRad; >+ //double W4rad = MapTo0To360Range(276.59 - 0.5118*t5)*dms::DegToRad; >+ > double W5 = MapTo0To360Range(267.2635- 1222.1136*t7); >- double W5rad = MapTo0To360Range(267.2635- 1222.1136*t7)*dms::DegToRad; >+ double W5rad = W5*dms::DegToRad; >+ //double W5rad = MapTo0To360Range(267.2635- 1222.1136*t7)*dms::DegToRad; > >- double W6 = MapTo0To360Range(175.4762 - 1221.5515*t7); >+ //double W6 = MapTo0To360Range(175.4762 - 1221.5515*t7); > double W6rad = MapTo0To360Range(175.4762 - 1221.5515*t7)*dms::DegToRad; > >- double W7 = MapTo0To360Range(2.4891 - 0.002435*t7); >+ //double W7 = MapTo0To360Range(2.4891 - 0.002435*t7); > double W7rad = MapTo0To360Range(2.4891 - 0.002435*t7)*dms::DegToRad; > >- double W8 = MapTo0To360Range(113.35 - 0.2597*t7); >+ //double W8 = MapTo0To360Range(113.35 - 0.2597*t7); > double W8rad = MapTo0To360Range(113.35 - 0.2597*t7)*dms::DegToRad; > > >@@ -276,7 +280,8 @@ > double theta = atanb1b2 + W8rad; > e = edash + 0.002778797*edash*cos(q); > p = w_ + 0.159215*sin(q); >- double u = 2*W5 - 2*theta + psi; >+ //double u = 2*W5 - 2*theta + psi; <-this is WRONG! W5 given in degrees while thetha + psi are in rad? >+ double u = 2*W5rad - 2*theta + psi; > double h = 0.9375*edash*edash*sin(q) + 0.1875*s*s*sin(2*(W5rad - theta)); > lambdadash = MapTo0To360Range(L - 0.254744*(e1*sin(W6rad) + 0.75*e1*e1*sin(2*W6rad) + h)); > i = idash + 0.031843*s*cos(u); >@@ -372,64 +377,64 @@ > u = (lambda1 - omega1)*dms::DegToRad; > w = (omega1 - 168.8112)*dms::DegToRad; > double gamma1rad = (gamma1)*dms::DegToRad; >- X[1] = r1*(cos(u)*cos(w) - sin(u)*cos(gamma1rad)*sin(w)); >- Y[1] = r1*(sin(u)*cos(w)*cos(gamma1rad) + cos(u)*sin(w)); >- Z[1] = r1*sin(u)*sin(gamma1rad); >+ X[0] = r1*(cos(u)*cos(w) - sin(u)*cos(gamma1rad)*sin(w)); >+ Y[0] = r1*(sin(u)*cos(w)*cos(gamma1rad) + cos(u)*sin(w)); >+ Z[0] = r1*sin(u)*sin(gamma1rad); > > u = (lambda2 - omega2)*dms::DegToRad; > w = (omega2 - 168.8112)*dms::DegToRad; > double gamma2rad = (gamma2)*dms::DegToRad; >- X[2] = r2*(cos(u)*cos(w) - sin(u)*cos(gamma2rad)*sin(w)); >- Y[2] = r2*(sin(u)*cos(w)*cos(gamma2rad) + cos(u)*sin(w)); >- Z[2] = r2*sin(u)*sin(gamma2rad); >+ X[1] = r2*(cos(u)*cos(w) - sin(u)*cos(gamma2rad)*sin(w)); >+ Y[1] = r2*(sin(u)*cos(w)*cos(gamma2rad) + cos(u)*sin(w)); >+ Z[1] = r2*sin(u)*sin(gamma2rad); > > u = (lambda3 - omega3)*dms::DegToRad; > w = (omega3 - 168.8112)*dms::DegToRad; > double gamma3rad = (gamma3)*dms::DegToRad; >- X[3] = r3*(cos(u)*cos(w) - sin(u)*cos(gamma3rad)*sin(w)); >- Y[3] = r3*(sin(u)*cos(w)*cos(gamma3rad) + cos(u)*sin(w)); >- Z[3] = r3*sin(u)*sin(gamma3rad); >+ X[2] = r3*(cos(u)*cos(w) - sin(u)*cos(gamma3rad)*sin(w)); >+ Y[2] = r3*(sin(u)*cos(w)*cos(gamma3rad) + cos(u)*sin(w)); >+ Z[2] = r3*sin(u)*sin(gamma3rad); > > u = (lambda4 - omega4)*dms::DegToRad; > w = (omega4 - 168.8112)*dms::DegToRad; > double gamma4rad = (gamma4)*dms::DegToRad; >- X[4] = r4*(cos(u)*cos(w) - sin(u)*cos(gamma4rad)*sin(w)); >- Y[4] = r4*(sin(u)*cos(w)*cos(gamma4rad) + cos(u)*sin(w)); >- Z[4] = r4*sin(u)*sin(gamma4rad); >+ X[3] = r4*(cos(u)*cos(w) - sin(u)*cos(gamma4rad)*sin(w)); >+ Y[3] = r4*(sin(u)*cos(w)*cos(gamma4rad) + cos(u)*sin(w)); >+ Z[3] = r4*sin(u)*sin(gamma4rad); > > u = (lambda5 - omega5)*dms::DegToRad; > w = (omega5 - 168.8112)*dms::DegToRad; > double gamma5rad = (gamma5)*dms::DegToRad; >- X[5] = r5*(cos(u)*cos(w) - sin(u)*cos(gamma5rad)*sin(w)); >- Y[5] = r5*(sin(u)*cos(w)*cos(gamma5rad) + cos(u)*sin(w)); >- Z[5] = r5*sin(u)*sin(gamma5rad); >+ X[4] = r5*(cos(u)*cos(w) - sin(u)*cos(gamma5rad)*sin(w)); >+ Y[4] = r5*(sin(u)*cos(w)*cos(gamma5rad) + cos(u)*sin(w)); >+ Z[4] = r5*sin(u)*sin(gamma5rad); > > u = (lambda6 - omega6)*dms::DegToRad; > w = (omega6 - 168.8112)*dms::DegToRad; > double gamma6rad = (gamma6)*dms::DegToRad; >- X[6] = r6*(cos(u)*cos(w) - sin(u)*cos(gamma6rad)*sin(w)); >- Y[6] = r6*(sin(u)*cos(w)*cos(gamma6rad) + cos(u)*sin(w)); >- Z[6] = r6*sin(u)*sin(gamma6rad); >+ X[5] = r6*(cos(u)*cos(w) - sin(u)*cos(gamma6rad)*sin(w)); >+ Y[5] = r6*(sin(u)*cos(w)*cos(gamma6rad) + cos(u)*sin(w)); >+ Z[5] = r6*sin(u)*sin(gamma6rad); > > u = (lambda7 - omega7)*dms::DegToRad; > w = (omega7 - 168.8112)*dms::DegToRad; > double gamma7rad = (gamma7)*dms::DegToRad; >- X[7] = r7*(cos(u)*cos(w) - sin(u)*cos(gamma7rad)*sin(w)); >- Y[7] = r7*(sin(u)*cos(w)*cos(gamma7rad) + cos(u)*sin(w)); >- Z[7] = r7*sin(u)*sin(gamma7rad); >+ X[6] = r7*(cos(u)*cos(w) - sin(u)*cos(gamma7rad)*sin(w)); >+ Y[6] = r7*(sin(u)*cos(w)*cos(gamma7rad) + cos(u)*sin(w)); >+ Z[6] = r7*sin(u)*sin(gamma7rad); > > u = (lambda8 - omega8)*dms::DegToRad; > w = (omega8 - 168.8112)*dms::DegToRad; > double gamma8rad = (gamma8)*dms::DegToRad; >- X[8] = r8*(cos(u)*cos(w) - sin(u)*cos(gamma8rad)*sin(w)); >- Y[8] = r8*(sin(u)*cos(w)*cos(gamma8rad) + cos(u)*sin(w)); >- Z[8] = r8*sin(u)*sin(gamma8rad); >- >- X[9] = 0; >- Y[9] = 0; >- Z[9] = 1; >+ X[7] = r8*(cos(u)*cos(w) - sin(u)*cos(gamma8rad)*sin(w)); >+ Y[7] = r8*(sin(u)*cos(w)*cos(gamma8rad) + cos(u)*sin(w)); >+ Z[7] = r8*sin(u)*sin(gamma8rad); >+ >+ X[8] = 0; >+ Y[8] = 0; >+ Z[8] = 1; > >- for ( int i=1; i<10; ++i ) { >+ for ( int i=0; i < 9; ++i ) { > A1[i] = X[i]; > B1[i] = c1*Y[i] - s1*Z[i]; > C1[i] = s1*Y[i] + c1*Z[i]; >@@ -448,7 +453,7 @@ > C4[i] = C3[i]*cos(ALPHA) - B3[i]*sin(ALPHA); > } > >- D = atan2(A4[9], C4[9]); >+ D = atan2(A4[8], C4[8]); > > //X and Y are now the rectangular coordinates of each satellite, > //in units of Jupiter's Equatorial radius.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 297467
:
213440
| 213582