X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2FUARTDebugSenderP.nc;h=ebce09bb6a3c9a740bfb6564e2d334e3bc011fd1;hb=da0cfeda9689aa64cfce0aa209f51803dcb11c21;hp=b339d87b80b5d0b2f80c7afa93368d7ac071e106;hpb=594acbf436f5f78611348f7763a89c84f38ba46a;p=tinyos-2.x.git diff --git a/tos/lib/net/UARTDebugSenderP.nc b/tos/lib/net/UARTDebugSenderP.nc index b339d87b..ebce09bb 100644 --- a/tos/lib/net/UARTDebugSenderP.nc +++ b/tos/lib/net/UARTDebugSenderP.nc @@ -79,7 +79,11 @@ implementation { return FAIL; } else { message_t* msg = call MessagePool.get(); - CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg); + CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg)); + if (dbg_msg == NULL) { + return FAIL; + } + memset(dbg_msg, 0, len); dbg_msg->type = type; @@ -102,7 +106,10 @@ implementation { return FAIL; } else { message_t* msg = call MessagePool.get(); - CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg); + CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg)); + if (dbg_msg == NULL) { + return FAIL; + } memset(dbg_msg, 0, len); dbg_msg->type = type; @@ -128,7 +135,10 @@ implementation { return FAIL; } else { message_t* msg = call MessagePool.get(); - CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg); + CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg)); + if (dbg_msg == NULL) { + return FAIL; + } memset(dbg_msg, 0, len); dbg_msg->type = type; @@ -154,7 +164,10 @@ implementation { return FAIL; } else { message_t* msg = call MessagePool.get(); - CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg); + CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg)); + if (dbg_msg == NULL) { + return FAIL; + } memset(dbg_msg, 0, len); dbg_msg->type = type; @@ -178,7 +191,10 @@ implementation { return FAIL; } else { message_t* msg = call MessagePool.get(); - CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg); + CollectionDebugMsg* dbg_msg = call UARTSend.getPayload(msg, sizeof(CollectionDebugMsg)); + if (dbg_msg == NULL) { + return FAIL; + } memset(dbg_msg, 0, len); dbg_msg->type = type;