[Tinyos-beta-commits] CVS: tinyos-1.x/beta/STM25P FlashVolumeM.nc, 1.1, 1.2

Jonathan Hui jwhui at users.sourceforge.net
Sun Nov 21 21:17:03 PST 2004


Update of /cvsroot/tinyos/tinyos-1.x/beta/STM25P
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11678

Modified Files:
	FlashVolumeM.nc 
Log Message:
- Fixed a bounds-checking bug that would always think the given
address is out-of-bounds.



Index: FlashVolumeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/FlashVolumeM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FlashVolumeM.nc	20 Nov 2004 18:59:43 -0000	1.1
--- FlashVolumeM.nc	22 Nov 2004 05:17:01 -0000	1.2
***************
*** 60,68 ****
    command stm25p_addr_t FlashVolume.physicalAddr[uint8_t id](uint32_t volumeAddr) {
  
!     stm25p_addr_t base = volumeMap[id]*FV_VOLUME_SIZE;
  
      if (volumeMap[id] == FV_INVALID_VOLUME
! 	|| volumeAddr < base
! 	|| (base+FV_VOLUME_SIZE) <= volumeAddr)
        return FV_INVALID_ADDR;
      
--- 60,67 ----
    command stm25p_addr_t FlashVolume.physicalAddr[uint8_t id](uint32_t volumeAddr) {
  
!     stm25p_addr_t base = (stm25p_addr_t)volumeMap[id]*FV_VOLUME_SIZE;
  
      if (volumeMap[id] == FV_INVALID_VOLUME
! 	|| volumeAddr >= FV_VOLUME_SIZE)
        return FV_INVALID_ADDR;
      



More information about the Tinyos-beta-commits mailing list