From kstars-devel Wed Oct 15 16:21:39 2008 From: Akarsh Simha Date: Wed, 15 Oct 2008 16:21:39 +0000 To: kstars-devel Subject: Re: [Kstars-devel] Suspicious code in KStars Message-Id: <20081015160939.GN4960 () PENGUIN> X-MARC-Message: https://marc.info/?l=kstars-devel&m=122408701908297 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0786157451==" --===============0786157451== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KaGhPsiNaI6/sRd6" Content-Disposition: inline --KaGhPsiNaI6/sRd6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi I have touched only these issues, because these are the bits of code I understand more easily. Will look at the others sometime later. > - kdeedu/kstars/kstars/skycomponents/starcomponent.cpp:144 >=20 > Add a todo comment to not forget this issue. Err, I made a commit that changed the line numbers, so I couldn't figure out which issue. > - kdeedu/kstars/kstars/skycomponents/constellationboundarylines.cpp:129 >=20 > If line 106 is not visited then polyList is NULL here. Fixed, hopefully, by a Q_ASSERT( polyList ); > - kdeedu/kstars/kstars/skycomponents/starblock.cpp:78 >=20 > plainStarTemplate is a pointer. Therefore &plainStarTemplate is a pointer= to=20 > a > pointer. The memory pointed at is only sizeof(void*) bytes long. Not > sizeof(StarObject). Fixed. Wonder why this wasn't giving any trouble. Probably it's just that the particular method is never called. > - kdeedu/kstars/kstars/kswizard.cpp:164 >=20 > If line 155 is false then Geo is NULL here. Fixed. I tried to produce a crash, but the code never leads to such a situation. Of course, it's dangerous code and should be fixed. I moved the functions that set Geo inside the if condition. Now is there a memory leak there? > - kdeedu/kstars/kstars/starobject.cpp:209-213 >=20 > =3D instead of =3D=3D here? Those should be '=3D's. I used the Perl-like constructs because they somehow felt more intuitive and readable to me. > - kdeedu/kstars/kstars/binfilehelper.cpp:120 >=20 > Leaking the pointer from line 118 here. Fixed with a delete de; Thanks a lot for pointing them out. Regards Akarsh --KaGhPsiNaI6/sRd6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkj2FcMACgkQkAo+aFFLL8NOrwCeIJYthPnaWykGpBOVMlWDHXfu nx8AoJzbhCHjO1kGa6rqJtNb6t2AtSw7 =k6ND -----END PGP SIGNATURE----- --KaGhPsiNaI6/sRd6-- --===============0786157451== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kstars-devel mailing list Kstars-devel@kde.org https://mail.kde.org/mailman/listinfo/kstars-devel --===============0786157451==--