From 11f4c1141d9257375d8bb14a543802ccc5ab5836 Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Thu, 6 Dec 2012 08:48:28 +0100 Subject: [PATCH] cmap: Handle NULL params in few more functions Signed-off-by: Jan Friesse Reviewed-by: Fabio M. Di Nitto --- lib/cmap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/cmap.c b/lib/cmap.c index 35937b74..8a5bed06 100644 --- a/lib/cmap.c +++ b/lib/cmap.c @@ -789,6 +789,10 @@ cs_error_t cmap_iter_init( struct req_lib_cmap_iter_init req_lib_cmap_iter_init; struct res_lib_cmap_iter_init res_lib_cmap_iter_init; + if (cmap_iter_handle == NULL) { + return (CS_ERR_INVALID_PARAM); + } + error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst)); if (error != CS_OK) { return (error); @@ -842,6 +846,10 @@ cs_error_t cmap_iter_next( struct req_lib_cmap_iter_next req_lib_cmap_iter_next; struct res_lib_cmap_iter_next res_lib_cmap_iter_next; + if (key_name == NULL) { + return (CS_ERR_INVALID_PARAM); + } + error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst)); if (error != CS_OK) { return (error); @@ -938,6 +946,10 @@ cs_error_t cmap_track_add( struct cmap_track_inst *cmap_track_inst; cmap_track_handle_t cmap_track_inst_handle; + if (cmap_track_handle == NULL || notify_fn == NULL) { + return (CS_ERR_INVALID_PARAM); + } + error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst)); if (error != CS_OK) { return (error); -- 2.39.5