Skip to content

Commit

Permalink
Prevent SysfsAdaptor::checkIntervalUsage from indexing out of bounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Rongas committed Feb 8, 2011
1 parent e1d4618 commit 8f7819d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 4 additions & 5 deletions core/sysfsadaptor.cpp
Expand Up @@ -359,11 +359,10 @@ bool SysfsAdaptor::checkIntervalUsage() const
if (mode_ == SysfsAdaptor::SelectMode)
{
const QList<DataRange>& list = getAvailableIntervals();
if (list.size() > 1){
if (list.first().min != list.first().max){
sensordLogW() << "Attempting to use PollMode interval() function for adaptor in SelectMode. Must reimplement!";
return false;
}
if (list.size() > 1 || (list.size() == 1 && list.first().min != list.first().max))
{
sensordLogW() << "Attempting to use PollMode interval() function for adaptor in SelectMode. Must reimplement!";
return false;
}
}
return true;
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
@@ -1,3 +1,10 @@
sensord (0.6.39) unstable; urgency=low

[Timo Rongas]
* Prevent reading values from empty list in SysfsAdaptor

-- Timo Rongas <ext-timo.2.rongas@nokia.com> Tue, 08 Feb 2011 13:35:32 +0200

sensord (0.6.38) unstable; urgency=low

[Shenghua Liu]
Expand Down
2 changes: 1 addition & 1 deletion sensord.pc
Expand Up @@ -4,7 +4,7 @@ libdir=${prefix}/lib/

Name: Sensord
Description: Sensord
Version: 0.6.38
Version: 0.6.39
Requires:
Libs: -L${libdir} -lsensorclient -lsensordatatypes
Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters

0 comments on commit 8f7819d

Please sign in to comment.