[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/Deluge DelugeManagerP.nc, 1.4, 1.5

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Mon Jan 21 16:41:02 PST 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17268/tos/lib/net/Deluge

Modified Files:
	DelugeManagerP.nc 
Log Message:
Check the image number against the DELUGE_NUM_VOLUMES. The bug was reported by David "wizzardx".


Index: DelugeManagerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/Deluge/DelugeManagerP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DelugeManagerP.nc	17 Jan 2008 22:27:38 -0000	1.4
--- DelugeManagerP.nc	22 Jan 2008 00:40:59 -0000	1.5
***************
*** 91,96 ****
      case DELUGE_CMD_ONLY_DISSEMINATE:
      case DELUGE_CMD_DISSEMINATE_AND_REPROGRAM:
!       if (call Resource.isOwner() || 
! 	  call Resource.immediateRequest() == SUCCESS) {
  	call DelugeMetadata.read(imgNum2volumeId[request->imgNum]);
        } else {
--- 91,97 ----
      case DELUGE_CMD_ONLY_DISSEMINATE:
      case DELUGE_CMD_DISSEMINATE_AND_REPROGRAM:
!       if (request->imgNum < DELUGE_NUM_VOLUMES &&
! 	  (call Resource.isOwner() || 
! 	   call Resource.immediateRequest() == SUCCESS)) {
  	call DelugeMetadata.read(imgNum2volumeId[request->imgNum]);
        } else {
***************
*** 99,102 ****
--- 100,107 ----
        break;
      case DELUGE_CMD_REPROGRAM:
+       if (!(request->imgNum < DELUGE_NUM_VOLUMES)) {
+ 	sendReply(FAIL);
+ 	break;
+       }
      case DELUGE_CMD_REBOOT:
        delugeCmd.imgNum = imgNum2volumeId[request->imgNum];



More information about the Tinyos-2-commits mailing list