Added some fixes from Jaroslav Fojtik submitted on sourceforge bug tracker:
authorMongo
Mon, 12 Sep 2011 10:52:02 +0200
changeset 668 ba53613e94e4
parent 667 f48424ce2a5e
child 669 50da44ebaf00
Added some fixes from Jaroslav Fojtik submitted on sourceforge bug tracker:
3096348 Missing "break" in states.c/canDispatch()
3096359 Crash inside dcf.c/send_consise_dcf()
3101891 Potencial overflow inside getNodeState()
src/dcf.c
src/lifegrd.c
src/states.c
--- a/src/dcf.c	Tue Aug 30 12:14:34 2011 +0200
+++ b/src/dcf.c	Mon Sep 12 10:52:02 2011 +0200
@@ -97,7 +97,7 @@
     /* If DCF entry do not exist... Nothing to do.*/
     if (errorCode != OD_SUCCESSFUL) goto DCF_finish;
   }
-
+  if(d->dcf_odentry->bSubCount<=nodeId) goto DCF_finish; /* Fix DCF table overflow */
   szData = d->dcf_odentry->pSubindex[nodeId].size;
   
   /* if the entry for the nodeId is not empty. */
--- a/src/lifegrd.c	Tue Aug 30 12:14:34 2011 +0200
+++ b/src/lifegrd.c	Mon Sep 12 10:52:02 2011 +0200
@@ -56,7 +56,11 @@
 **/
 e_nodeState getNodeState (CO_Data* d, UNS8 nodeId)
 {
-  e_nodeState networkNodeState = d->NMTable[nodeId];
+  e_nodeState networkNodeState = Unknown_state;
+  #if NMT_MAX_NODE_ID>0
+  if(nodeId < NMT_MAX_NODE_ID)
+    networkNodeState = d->NMTable[nodeId];
+  #endif
   return networkNodeState;
 }
 
--- a/src/states.c	Tue Aug 30 12:14:34 2011 +0200
+++ b/src/states.c	Mon Sep 12 10:52:02 2011 +0200
@@ -100,6 +100,7 @@
 			{
 				proceedNMTstateChange(d,m);
 			}
+            break;
 #ifdef CO_ENABLE_LSS
 		case LSS:
 			if (!d->CurrentCommunicationState.csLSS)break;