Bug 303547 - Bug in SkyQPainter.drawSkyPolyline
Summary: Bug in SkyQPainter.drawSkyPolyline
Alias: None
Product: kstars
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Akarsh Simha
Keywords: junior-jobs
Depends on:
Reported: 2012-07-15 10:59 UTC by Alexey Khudiakov
Modified: 2013-10-18 13:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.3


Note You need to log in before you can comment on or make changes to this bug.
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