2017-02-21 Fred Gleason <fredg@paravelsystems.com>

* Modified 'lib/rdformpost.cpp' to use read-only accessors for
	std::map values.
	* Added a check for valid event IDs for the 'SaveLog' method in
	'web/rdxport/logs.cpp'.
This commit is contained in:
Fred Gleason
2017-02-21 16:51:25 -05:00
parent bc55c06eee
commit db0e842496
3 changed files with 22 additions and 11 deletions

View File

@@ -266,9 +266,14 @@ void Xport::SaveLog()
QDateTime datetime;
QTime time;
bool state;
if(!xport_post->getValue(line+"_ID",&integer1)) {
bool ok=false;
if(!xport_post->getValue(line+"_ID",&integer1,&ok)) {
XmlExit("Missing "+line+"_ID",400);
}
if(!ok) {
XmlExit("Invalid "+line+"_ID",400);
}
ll->setId(integer1);
if(!xport_post->getValue(line+"_TYPE",&integer1)) {
@@ -452,5 +457,5 @@ void Xport::SaveLog()
logevt->save();
XmlExit("OK",200);
XmlExit(QString().sprintf("OK Saved %d events",logevt->size()),200);
}