[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    Re: [Kstars-devel] Suspicious code in KStars
From:       Akarsh Simha <akarshsimha () gmail ! com>
Date:       2008-10-15 16:21:39
Message-ID: 20081015160939.GN4960 () PENGUIN
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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
> 
> 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
> 
> 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
> 
> plainStarTemplate is a pointer. Therefore &plainStarTemplate is a pointer to 
> 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
> 
> 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
> 
> = instead of == here?

Those should be '='s. I used the Perl-like constructs because they
somehow felt more intuitive and readable to me.

> - kdeedu/kstars/kstars/binfilehelper.cpp:120
> 
> Leaking the pointer from line 118 here.

Fixed with a delete de;

Thanks a lot for pointing them out.

Regards
Akarsh

["signature.asc" (application/pgp-signature)]

_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic