From 1651051cdca603d2cf9cee6a1645a58f11695c63 Mon Sep 17 00:00:00 2001 From: Suresh Kumar N Date: Mon, 12 May 2014 12:28:12 +0530 Subject: [PATCH] Add NULL check for AT Request Change-Id: I4ead55dfc257fb98dc320607718865bfb734ff4b --- src/at.c | 10 ++++++++++ tel-headers/introspection/sat.xml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/at.c b/src/at.c index b3ba72a..92216a3 100644 --- a/src/at.c +++ b/src/at.c @@ -491,6 +491,11 @@ TelReturn tcore_at_set_request(TcoreAT *at, TcoreAtRequest *req) dbg("AT Request - Command: [%s] Pre-fix: [%s] Type: [%d])", at->req->cmd, at->req->prefix, at->req->type); } + else { + err("AT request is NULL"); + return TEL_RETURN_INVALID_PARAMETER; + } + return TEL_RETURN_SUCCESS; } @@ -505,6 +510,11 @@ TelReturn tcore_at_send_data(TcoreAT *at, TcoreAtRequest *req, gboolean send) return TEL_RETURN_INVALID_PARAMETER; } + if (req == NULL) { + err("AT request is NULL"); + return TEL_RETURN_INVALID_PARAMETER; + } + if ((ret = tcore_at_set_request(at, req)) != TEL_RETURN_SUCCESS) { err("Failed to set AT request"); return ret; diff --git a/tel-headers/introspection/sat.xml b/tel-headers/introspection/sat.xml index 85b5cff..0515c1e 100644 --- a/tel-headers/introspection/sat.xml +++ b/tel-headers/introspection/sat.xml @@ -29,7 +29,7 @@ - + -- 2.7.4