2017-05-24 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in 'ripcd/livewiremcastgpio.cpp' that caused a segfault
	when send a LiveWire multicast GPIO event that existed in the driver
	configuration but was beyond the number of active GPIOS set.
This commit is contained in:
Fred Gleason 2017-05-25 07:59:31 -04:00
parent ab2fda27d2
commit bb0876fa65
2 changed files with 9 additions and 11 deletions

View File

@ -15806,3 +15806,7 @@
code at program shutdown. code at program shutdown.
2017-05-23 Fred Gleason <fredg@paravelsystems.com> 2017-05-23 Fred Gleason <fredg@paravelsystems.com>
* Incremented the package version to 2.15.3int07. * Incremented the package version to 2.15.3int07.
2017-05-24 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'ripcd/livewiremcastgpio.cpp' that caused a segfault
when send a LiveWire multicast GPIO event that existed in the driver
configuration but was beyond the number of active GPIOS set.

View File

@ -143,9 +143,11 @@ LiveWireMcastGpio::LiveWireMcastGpio(RDMatrix *matrix,QObject *parent)
"order by SLOT"; "order by SLOT";
q=new RDSqlQuery(sql); q=new RDSqlQuery(sql);
while(q->next()) { while(q->next()) {
livewire_source_numbers[q->value(0).toInt()]=q->value(1).toInt(); if(q->value(0).toInt()<((int)livewire_gpios/RD_LIVEWIRE_GPIO_BUNDLE_SIZE)) {
livewire_surface_addresses[q->value(0).toInt()]= livewire_source_numbers[q->value(0).toInt()]=q->value(1).toInt();
QHostAddress(q->value(2).toString()); livewire_surface_addresses[q->value(0).toInt()]=
QHostAddress(q->value(2).toString());
}
} }
delete q; delete q;
} }
@ -231,14 +233,6 @@ void LiveWireMcastGpio::processCommand(RDMacro *cmd)
} }
ProcessGpoIn(livewire_source_numbers[slot],line,cmd->arg(3).toInt()); ProcessGpoIn(livewire_source_numbers[slot],line,cmd->arg(3).toInt());
livewire_gpo_in_states[cmd->arg(2).toInt()-1]=cmd->arg(3).toInt(); livewire_gpo_in_states[cmd->arg(2).toInt()-1]=cmd->arg(3).toInt();
/*
emit gpiChanged(livewire_matrix,cmd->arg(2).toInt()-1,
cmd->arg(3).toInt());
if(cmd->arg(4).toInt()>0) {
livewire_gpi_timers[cmd->arg(2).toInt()-1]->
start(cmd->arg(4).toInt(),true);
}
*/
} }
if(cmd->arg(1).toString().lower()=="o") { if(cmd->arg(1).toString().lower()=="o") {
slot=(cmd->arg(2).toInt()-1)/5; slot=(cmd->arg(2).toInt()-1)/5;