]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
bugfix: the buffer passed to ReadStream.postBuffer() must have a certain minimum...
authorjanhauer <janhauer>
Wed, 9 Apr 2008 08:56:30 +0000 (08:56 +0000)
committerjanhauer <janhauer>
Wed, 9 Apr 2008 08:56:30 +0000 (08:56 +0000)
tos/chips/atm128/adc/AdcStreamP.nc

index 9435c30f2a39bf93ed29dc8f9aa2438f6443767c..6bc47bc1272199dd6447220bb50bea15c322f5e8 100644 (file)
@@ -104,6 +104,8 @@ implementation {
   }
 
   command error_t ReadStream.postBuffer[uint8_t c](uint16_t *buf, uint16_t n) {
+    if (n < sizeof(struct list_entry_t))
+      return ESIZE;
     atomic
       {
        struct list_entry_t *newEntry = (struct list_entry_t *)buf;