From 6c2852cb4098d7aedc5bc8128c4a15afa2699015 Mon Sep 17 00:00:00 2001 From: Sam Nelson Date: Fri, 4 Oct 2019 23:28:46 -0400 Subject: [PATCH] TransportRpmsg: Add NULL check to avoid NULL pointer access Signed-off-by: Sam Nelson --- packages/ti/ipc/transports/TransportRpmsg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/ti/ipc/transports/TransportRpmsg.c b/packages/ti/ipc/transports/TransportRpmsg.c index d863b1a..365cca0 100644 --- a/packages/ti/ipc/transports/TransportRpmsg.c +++ b/packages/ti/ipc/transports/TransportRpmsg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013, Texas Instruments Incorporated + * Copyright (c) 2012-2019, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -306,6 +306,10 @@ static Void transportCallbackFxn(RPMessage_Handle msgq, UArg arg, Ptr data, /* Make sure buf is not NULL */ Assert_isTrue(buf != NULL, NULL); + if (buf == NULL) { + Log_print0(Diags_INFO, FXNN" MessageQ_alloc failed \n"); + goto exit; + } /* copy the message to the buffer allocated. */ memcpy((Ptr)buf, (Ptr)msg, msgSize); -- 2.39.2