]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/Deluge/FlashVolumeManager/FlashVolumeManagerP.nc
Check the image number against the DELUGE_NUM_VOLUMES. The bug was reported by David...
[tinyos-2.x.git] / tos / lib / net / Deluge / FlashVolumeManager / FlashVolumeManagerP.nc
index 657d6795901340670d415bc907f47eeeba994a9c..56558c4214a17c8b14bf11c143a016a5e005de59 100644 (file)
@@ -186,7 +186,7 @@ implementation
     }
 
     // Converts the image number that the user wants to the real image number
-    imgNum = imgNum2volumeId[request->imgNum];
+    imgNum = request->imgNum < DELUGE_NUM_VOLUMES ? imgNum2volumeId[request->imgNum] : 0xFF;
     
     if (imgNum != 0xFF) {
       error = SUCCESS;