From: kibak.yoon Date: Sun, 21 May 2017 07:03:23 +0000 (+0900) Subject: sensor: rec: check invalid parameter X-Git-Tag: submit/tizen/20170521.102545^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3af9733991943ace8731620f0092d17e54c2e38b;p=platform%2Fcore%2Fapi%2Fsensor.git sensor: rec: check invalid parameter Change-Id: I59ee8d38949bc3673f82ef72d58a49050a73f7bd Signed-off-by: kibak.yoon --- diff --git a/src/sensor_recorder.cpp b/src/sensor_recorder.cpp index c8cf0a1..3139bc1 100644 --- a/src/sensor_recorder.cpp +++ b/src/sensor_recorder.cpp @@ -207,6 +207,8 @@ int sensor_recorder_read(sensor_type_e type, sensor_recorder_query_h query, sens if (sensor_keys.find(type) == sensor_keys.end()) return SENSOR_ERROR_INVALID_PARAMETER; + if (!query || !cb) + return SENSOR_ERROR_INVALID_PARAMETER; _sensor_rec_info *info = new(std::nothrow) _sensor_rec_info; if (!info) @@ -228,6 +230,8 @@ int sensor_recorder_read_sync(sensor_type_e type, sensor_recorder_query_h query, if (sensor_keys.find(type) == sensor_keys.end()) return SENSOR_ERROR_INVALID_PARAMETER; + if (!query || !cb) + return SENSOR_ERROR_INVALID_PARAMETER; _sensor_rec_info *info = new(std::nothrow) _sensor_rec_info; if (!info)