]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/atm128/adc/AdcStreamP.nc
bugfix: the buffer passed to ReadStream.postBuffer() must have a certain minimum...
[tinyos-2.x.git] / 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;