Bug 303547

Summary: Bug in SkyQPainter.drawSkyPolyline
Product: [Applications] kstars Reporter: Alexey Khudiakov <alexey.skladnoy>
Component: generalAssignee: Akarsh Simha <akarsh.simha>
Status: RESOLVED FIXED    
Severity: normal CC: mutlaqja, rakuco
Priority: NOR Keywords: junior-jobs
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.3

Description Alexey Khudiakov 2012-07-15 10:59:56 UTC
Bug reported by the clang static analyzer.

Description: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
File: /home/kdedev/kstars/kstars/skyqpainter.cpp
Line: 230

void SkyQPainter::drawSkyPolyline(LineList* list, SkipList* skipList, LineListLabel* label)
{
    SkyList *points = list->points();
    bool isVisible, isVisibleLast;
    // & with the result of checkVisibility to clip away things below horizon
    isVisibleLast &= m_proj->checkVisibility( points->first() );  <--- BUG
Comment 1 Albert Astals Cid 2013-10-18 13:55:27 UTC
Git commit 37bc667dbdaee94af87d44c2493620db5f31644a by Albert Astals Cid, on behalf of Vijay Dhameliya.
Committed on 18/10/2013 at 13:54.
Pushed by aacid into branch 'KDE/4.11'.

Ordered visibility check for first point of SkyPolyLine in drawSkyPolyline function

Variable isVisibleLast and isVisible are not initialized so stores random value while operated and with check visibility and correct visibility of point are stored in same variable when passed to toScreen function.

Approved by Henry de Valence
REVIEW: 112726
FIXED-IN: 4.11.3

M  +4    -4    kstars/skyqpainter.cpp

http://commits.kde.org/kstars/37bc667dbdaee94af87d44c2493620db5f31644a